Closed aolkin closed 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).
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.
Yes, this was pointed out in a comment last year; feel free to submit a pull request!
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:
Instead of parsing HTML, you can just grab the metadata directly from the JSON files.