23
Oct
08

Scraping your reviews

So, I’m sure you’ve all been there with us on your first iPhone app: Soon as it’s up there you want to see ALL the reviews! Right NOW! NOW NOW NOW! But iTunes only lets you see the reviews for the country you have an account in, bah! So how do you get around this conundrum? Well, you could make friends with people with iTunes accounts in the other 61-odd countries, I suppose; or, you could simply apply this script from voluminous authoress Erica Sadun:

As you know, iTunes currently exists in 60-odd countries. 62 if I’ve done my counting right. Each store has its own storefront code, which I have laboriously produced for you below. Seriously, this took forever! These country codes allow you to access AppStore for each country and retrieve the review data you’re looking for…

The user review URL shown here returns the first page of the most recent (sortOrdering=2) reviews. You can retrieve those reviews directly from the Terminal command-line.

To talk to iTunes from curl, spoof the user agent to pretend to be iTunes and set your store front to one of the legal values. Here, I set the store by passing it as a header field using curl’s -H switch…

The last step involves looping this over all available stores. It’s easy to throw together a perl script that does exactly that, opening the results in TextEdit. The source for that script follows at the bottom of this post.

Incredibly useful, no? But it gets better! Another fellow Jeremy Wohl took this and ran with it to fix various issues and call Google Translate as well, you can find that hosted on github here; and for the absolute ultimate in convenience, yet another fellow John Ballinger has written that into a Dashboard widget. Really couldn’t ask for anything more, could you?


Leave a Reply