Dinosaur Comics Easter Eggs NG

By Ben Bleything Last update Nov 17, 2008 — Installed 3,074 times.

First Page and Archived Pages

in
Subscribe to First Page and Archived Pages 1 post, 1 voice

nimrodg User

The script as it is doesn't seem to work for me on the first page, but archived pages work. The difference is the small comment Ryan puts at the top of the first page some times, e.g: "merry christmas and happy holidays! dinosaur comics is in CRAZY RERUN MODE until the new year. i'm running some favourite strips from the mysterious past!"

I've made a small modification to the script locally which fixes the issue, but isn't terribly elegant:

--- dinosaur_comics_easter_e_old.user.js 2008-12-31 13:33:40.000000000 +0000
+++ dinosaur_comics_easter_e.user.js 2008-12-31 13:32:36.000000000 +0000
@@ -31,6 +31,10 @@
rss_title = rss_title.substring( 25, (rss_title.length - 8) );

var comic_img = $x("//span[@class='rss-content']/table/tbody/tr/td/center/font/img")[0];
+if (!comic_img) {
+ // Probably on first page. try to skip small comment.
+ comic_img = $x("//span[@class='rss-content']/table/tbody/tr/td/center/p/font/img")[0];
+}
var comic_title = comic_img.getAttribute( 'title' );

var comments_href = $x("//a[contains(@href, 'mailto')]")[0].href;

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel