1

I have discovered through my reading of XKCD that it feels funnier when viewed randomly. However, since I have read about 2/3 of the comics, that I am quickly getting into repetetive clicking of the random button to find a new one. So I'd like to find or build a tool that:

  • builds a list of all pages in a site (eg. xkcd.com/*)
  • removes pages from the list that are in firefox's history
  • randomly selects from the list of unviewed pages and redirects firefox to that page

So I think I could program a userscript to do this. But I'm not sure how to approach that.

A fact that I'm ignoring is XKCD (not to mention SMBC, Youtube, and others) offers RSS. If there was an RSS Reader that could download the feed from the beginning and randomly select from the ones which have not been viewed, that would be preferable because that limits the search to desirable content. What's your input? Know of any tools to do this?

1 Answers1

2

This is a general outline of how one might go about accomplishing this:

One very helpful fact about XKCD comics is that all of the URL's are in the form of

http://xkcd.com/####/

where #### is a number from 1 to 1230 (as of today)

Part I: Create a new random comic generator

  1. Creates a list of all numbers in that range
  2. Randomly chooses a number from the list
  3. Remove the number from the list
  4. Generate a url from the using the number picked

Now the trickier part -

Part II: Remove all the comics that you have already visited:

NOTE: This part is kind of convoluted, and not very portable - but hey it works.

  1. In Firefox - go to show all history
  2. Search for xkcd.com
  3. Drag all the links to a new bookmarks folder
  4. Export your bookmarks as html format
  5. Edit the html to remove all but the folder just created
  6. Loop through the file, and add all numbers found to a list.
  7. Subtract this list from the one in Part I

I realize I have glossed over lots of the details, but this should at least give you an idea of how to proceed. It seems like a fun little project - Good luck!