Open the Mac App Store in your browser

I was up late last night building a Mac App Store scraper. In the process I discovered how to browse the store in Safari. Without further ado, let me share the geek.
It turns out you can spoof curl with the Mac App Store user agent to access its data. You'll need to use Terminal for this trick, so if you're uncomfortable with the command line, it's sort of time to skip to the next post.
Still here? Good, let's go.
First, grab and open New & Noteworthy page with the following commands:
curl -silent -A "iMacAppStore/1.0.1 (Macintosh; U; Intel Mac OS X 10.6.7; en) AppleWebKit/533.20.25" 'http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewGrouping?id=29526&mt=12' > ~/Desktop/foo.html; open ~/Desktop/foo.html
Conversely, just open the front page:
curl -silent -A "iMacAppStore/1.0.1 (Macintosh; U; Intel Mac OS X 10.6.7; en) AppleWebKit/533.20.25" 'http://itunes.apple.com/us/genre/mac/id39?mt=12' > ~/Desktop/foo.html; open ~/Desktop/foo.html
The front page doesn't always want to open properly, but if you load another primary page like New & Noteworthy first, it usually loads the way you're looking for.
Some will want to ignore the HTTP status that appears at the top of the webpage -- but they'll probably be using the App itself, so it shouldn't be a problem for everyone else. Have fun!
Share
Source: http://tuaw.com/tag/hacksugar
Categories
I was up late last night building a Mac App Store scraper. In the process I discovered how to browse the store in Safari. Without...
Add a Comment
Very clever, but why?
July 16 2011 at 5:21 PM Report abuse Permalink rate up rate down ReplyHow about:
http://itunes.apple.com/us/genre/mac/id39?mt=12
If you are not really comfortable with Terminal the free app Kino Worksheet makes it a little bit easier, great for power users too!
http://www.justinsloan.com/pmwiki.php/Pages/Software
I didn't do anything special, and this URL works just fine in my browser (Chrome Mac) :
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewGrouping?id=29526&mt=12
why not just change the user-agent in safari using the developer-menu? http://bit.ly/mU9X7L
July 14 2011 at 4:41 PM Report abuse Permalink rate up rate down ReplyIf you have Chrome installed, you can just run the following command:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-agent="iMacAppStore/1.0.1 (Macintosh; U; Intel Mac OS X 10.6.7; en) AppleWebKit/533.20.25"
And then paste in the URL.
"So come up to the lab and see what's on the slab. I see you shiver with antici.............................................................................................................................................................................................................................................................................................................................................................................................................pation"
July 14 2011 at 4:12 PM Report abuse Permalink rate up rate down Reply.................................................pation."
July 14 2011 at 4:14 PM Report abuse Permalink rate up rate down ReplyI've been feverishly checking myself, wish I could turn off that part of my brain.
July 14 2011 at 4:21 PM Report abuse Permalink rate up rate downDeals of the Day
more deals- Acoustic Research Digital Photo Frame with iPod Dock for $50 + free shipping
- Targus Truss Case for iPad and iPad 2 for $15 + free shipping
- Apple iPhone 4 8GB for Verizon, AT&T, or Sprint for $50 + pickup at Best Buy
- Unlocked iPhone 4S 16GB for GSM (AT&T, T-Mobile) for $619 + free shipping
- Apple iMac Core i7 Quad 3.4GHz 27" w/ 24GB RAM, 2TB HDD for $2,677 + $29 s&h
- Used Apple Magic Mouse for $36 + $4 s&h
9 Comments