tylerbutler / xkcd2

http://www.tylerbutler.com/2012/05/17/xkcd-2/
MIT License
14 stars 4 forks source link

Use JSON to pull metadata instead of scraping html #6

Closed aolkin closed 9 years ago

aolkin commented 9 years ago

xkcd.com actually has a JSON API for retrieving comic metadata that should be more reliable and less likely to change, and also easier to parse. From the about page:

Is there an interface for automated systems to access comics and metadata?

Yes. You can get comics through the JSON interface, at URLs like http://xkcd.com/info.0.json (current comic) and http://xkcd.com/614/info.0.json (comic #614).

Instead of parsing HTML, you can just grab the metadata directly from the JSON files.

tylerbutler commented 9 years ago

Yes, this was pointed out in a comment last year; feel free to submit a pull request!