Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Read XKCD on the iPhone .. Finally (blendedtechnologies.com)
5 points by tocomment on Sept 27, 2008 | hide | past | favorite | 3 comments



The way it works isn't terribly reliable, since it counts on the comic being the element on the page with the longest title. A quick View Source reveals a dearth of helpful hooks like classes or ids, but the comic image is the only one with a URL of the form http://imgs.xkcd.com/comics/comic_name.png, so it might be better to check for that. Here's some new bookmarklet code based on this approach.

http://gist.github.com/13311

Obviously this will break if there are ever two comics on the page, since it will just print an alert for the first one and execution will then halt.


I decided to run a small test to see whether the comic's title was always the longest title of any image. Here's the screen scraper I wrote for it:

http://gist.github.com/13315

I discovered that following comics don't have the longest title of any image on the page: 11, 18, 25, 27, 76, 82, 99, 126, 393, 412, 455.


Wow I had no idea. Your way is probably smarter.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: