I want to generate a couple of plots/graphs with Area 51 statistics. Since Area 51 doesn't work with the SE API, I'm forced to find another way to get the information I want.
That other way is with RegularExpression[]
(or Mathematica's string patterns). Let's start with a specific example, then move on to a more general case.
Mathematica lets me fetch the source of an HTML
page with
src=Import["http://area51.stackexchange.com/proposals/4470/martial-arts","Source"];
src
now contains a string, which is the source code of the page.
What am I looking for?
The information that interests me is the value inside each of the blue squares, as well as its textual counterpart, namely Needs Work, Okay, or Excellent.
I would use something like
StringCases[a,
RegularExpression[
"regex"] ->
"$1"]
to get the data I want, but unfortunately I don't know how to write regexes.
Side question: should I use Mathematica's string patterns, or RegularExpression[]
?
The more general case
Once I can fetch the data above for one site, it's a piece of cake to get it for every proposal in beta. My goal is to be able to plot this data, to see how our site compares against the others concerning SE's top 5 health indicators.