Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I'm working on a Stack Exchange extension to help tag wiki editors. It uses the API to find out which tags referred to on every page have or lack a wiki or excerpt.

I'm using the API as efficiently as possible and I've asked questions on StackApps about not overstepping the line, but it still can break the throttling rules.

To fix this I want to do some aggressive smart caching and only call the API when necessary.

One way to do this is to scrape the pages for where this info is already given "for free".

One place I'm scraping is the tag popup windows when you hover over a tag. I'm using the new HTML5 mutation observers for this. They pass a packet of DOM references for each change you've registered. You then have to walk these DOM fragments. It's not yet clear if jQuery selectors can be used to save all the tricky DOM walking.

The current HTML structure of the tag popup contains a <div class="tm-description">, which contains text (I'm not sure if it's the excerpt, the wiki, or uses heuristics to be one or the other.

Now if there is no wiki the text is hard-coded to "help us edit this wiki". It would be much more deterministic if the div had one or more additional classeses. Checking for this will break if the text changes in the future or if localization is added to the site.

Easiest would be including or omitting blank. But it may not be any extra effort to include classes such as has-wiki, no-excerpt etc. Perhaps mimicking the field names the tags APIs use.

share|improve this question
Did you just post a feature request for a hack? Unacceptable! ;P – Yannis Sep 26 '12 at 7:54
For anyone who didn't partake in the previous discussion, before asking this question, I asked about asking this type of question. – hippietrail Sep 26 '12 at 8:01
@YannisRizos: I consider it a tool but people in the previous discussion called it a hack so I humbly adopted their language (-; – hippietrail Sep 26 '12 at 8:02
Just FYI, the text in the popup box is the first x characters of the wiki excerpt (it cuts off really long ones, but I don't know the exact character count). – animuson Sep 26 '12 at 12:22
@animuson: So if a tag has a wiki but no excerpt it will still be blank? I know in some place in Stack Exchange something like that happens but I forget where. – hippietrail Sep 26 '12 at 13:06
@hippietrail: Yes, it's a weird thing. It only shows excerpts if there is also a wiki. – animuson Sep 27 '12 at 2:00

You must log in to answer this question.

Browse other questions tagged .