User:Tom/Greasemonkey Script

From Homestar Runner Wiki

< User:Tom
Revision as of 19:14, 31 October 2005 by Tom (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

I've been developing the following Greasemonkey script to allow one to have links to Wiki articles from Homestar Runner toons. It's pretty cool. Feel free to help out by adding toons, etc. in the same format. I started with the Strong Bad Emails, since they just go nicely along in order.

Code recommendations are also welcome, but everything works just fine as of right now.

Code

// ==UserScript==
// @name		Homestar Runner - Add hrwiki.org links.
// @namespace		http://www.hrwiki.org/index.php/User:Tom/Greasemonkey_Script
// @description		Adds links to Homestar Runner Wiki articles from homestarrunner.com toons, etc.
// @include		http://www.homestarrunner.com/*.html
// @include		http://homestarrunner.com/*.html

// ==/UserScript==

(function() {
   
  var file = window.location.pathname;
  var a = document.createElement('a');
  var wikiPage;
    
  if (file == '/sbemail1.html') {
	wikiPage = 'some_kinda_robot';
	}
	
  if (file == '/sbemail2.html') {
	wikiPage = 'homsar';
	}

  if (file == '/sbemail3.html') {
	wikiPage = 'butt_IQ';
	}
	
  if (file == '/sbemail4.html') {
	wikiPage = 'homestar_hair';
	}
	
  if (file == '/sbemail5.html') {
	wikiPage = 'making_out';
	}
	
  if (file == '/sbemail6.html') {
	wikiPage = 'depressio';
	}
	
  if (file == '/sbemail7.html') {
	wikiPage = 'halloweener';
	}
	
  if (file == '/sbemail8.html') {
	wikiPage = 'brianrietta';
	}
	
  if (file == '/sbemail9.html') {
	wikiPage = 'i_love_you';
	}
	
  if (file == '/sbemail10.html') {
	wikiPage = 'trevor_the_vampire';
	}
	
  if (file == '/sbemail11.html') {
	wikiPage = 'i_rule';
	}
	
  if (file == '/sbemail12.html') {
	wikiPage = 'credit_card';
	}
	
  if (file == '/sbemail13.html') {
	wikiPage = 'i_she_be';
	}
	
  if (file == '/sbemail14.html') {
	wikiPage = 'duck_pond';
	}
	
  if (file == '/sbemail15.html') {
	wikiPage = 'the_basics';
	}
	
  if (file == '/sbemail16.html') {
	wikiPage = 'band_names';
	}
	
  if (file == '/sbemail17.html') {
	wikiPage = 'studying';
	}
	
  if (file == '/sbemail18.html') {
	wikiPage = 'stand-up';
	}
	
  if (file == '/sbemail19.html') {
	wikiPage = 'tape-leg';
	}
	
  if (file == '/sbemail20.html') {
	wikiPage = 'spring_cleaning';
	}
	
  if (file == '/sbemail21.html') {
	wikiPage = 'cartoon';
	}
	
  if (file == '/sbemail22.html') {
	wikiPage = 'sb_email_22';
	}
	
  if (file == '/sbemail23.html') {
	wikiPage = 'little_animal';
	}
	
  if (file == '/sbemail24.html') {
	wikiPage = 'the_bird';
	}
	
  if (file == '/sbemail25.html') {
	wikiPage = 'super_powers';
	}
	
  if (file == '/sbemail26.html') {
	wikiPage = 'CGNU';
	}
	
  if (file == '/sbemail27.html') {
	wikiPage = '3_Wishes';
	}
	
  if (file == '/sbemail28.html') {
	wikiPage = '1_step_ahead';
	}
	
  if (file == '/sbemail29.html') {
	wikiPage = 'superhero_name';
	}
	
  if (file == '/sbemail30.html') {
	wikiPage = '12:00';
	}
	
  if (file == '/sbemail31.html') {
	wikiPage = 'sugarbob';
	}
	
  if (file == '/sbemail32.html') {
	wikiPage = 'flag_day';
	}
	
  if (file == '/sbemail33.html') {
	wikiPage = 'gimmicks';
	}
	
  if (file == '/sbemail34.html') {
	wikiPage = 'weird dream';
	}
	
  if (file == '/sbemail35.html') {
	wikiPage = 'sisters';
	}
	
  if (file == '/sbemail36.html') {
	wikiPage = 'guitar';
	}
	
  if (file == '/sbemail37.html') {
	wikiPage = 'dullard';
	}
	
  if (file == '/sbemail38.html') {
	wikiPage = 'helium';
	}
	
  if (file == '/sbemail39.html') {
	wikiPage = 'property_of_ones';
	}
	
  if (file == '/sbemail40.html') {
	wikiPage = 'vacation';
	}
	
  if (file == '/sbemail41.html') {
	wikiPage = 'invisibility';
	}
	
  if (file == '/sbemail42.html') {
	wikiPage = 'action_figure';
	}

  if (file == '/sbemail43.html') {
	wikiPage = 'little_questions';
	}

  if (file == '/sbemail44.html') {
	wikiPage = 'lures_&_jigs';
	}

  if (file == '/sbemail45.html') {
	wikiPage = 'techno';
	}

  if (file == '/sbemail46.html') {
	wikiPage = 'your_friends';
	}

  if (file == '/sbemail47.html') {
	wikiPage = 'new_hands';
	}

  if (file == '/sbemail48.html') {
	wikiPage = 'ghosts';
	}

  if (file == '/sbemail49.html') {
	wikiPage = 'theme_party';
	}

  if (file == '/sbemail50.html') {
	wikiPage = '50_emails';
	}

  if (file == '/sbemail51.html') {
	wikiPage = 'website';
	}

  if (file == '/sbemail52.html') {
	wikiPage = 'island';
	}

  if (file == '/sbemail53.html') {
	wikiPage = 'comic';
	}

  if (file == '/sbemail54.html') {
	wikiPage = 'morning_routine';
	}

  if (file == '/sbemail55.html') {
	wikiPage = 'cheat_talk';
	}

  if (file == '/sbemail56.html') {
	wikiPage = 'current_status';
	}

  if (file == '/sbemail57.html') {
	wikiPage = 'japanese_cartoon';
	}

  if (file == '/sbemail58.html') {
	wikiPage = 'dragon';
	}

  if (file == '/sbemail59.html') {
	wikiPage = 'marzipan';
	}

  if (file == '/sbemail60.html') {
	wikiPage = 'huttah!';
	}
	
  if (file == '/sbemail61.html') {
	wikiPage = 'monster_truck';
	}

  if (file == '/sbemail62.html') {
	wikiPage = 'interview';
	}

  if (file == '/sbemail63.html') {
	wikiPage = 'fingers';
	}

  if (file == '/sbemail64.html') {
	wikiPage = 'english_paper';
	}

  if (file == '/sbemail65.html') {
	wikiPage = 'unused_emails';
	}

  if (file == '/sbemail66.html') {
	wikiPage = 'the_show';
	}

  if (file == '/sbemail67.html') {
	wikiPage = 'autobiography';
	}

  if (file == '/sbemail68.html') {
	wikiPage = 'caper';
	}

  if (file == '/sbemail69.html') {
	wikiPage = 'personal_favorites';
	}

  if (file == '/sbemail70.html') {
	wikiPage = 'big_white_face';
	}

  if (file == '/sbemail71.html') {
	wikiPage = '2_emails';
	}

  if (file == '/sbemail72.html') {
	wikiPage = 'crazy_cartoon';
	}

  if (file == '/sbemail73.html') {
	wikiPage = 'mascot';
	}

  if (file == '/sbemail74.html') {
	wikiPage = 'privileges';
	}

  if (file == '/sbemail75.html') {
	wikiPage = 'funny';
	}

  if (file == '/sbemail76.html') {
	wikiPage = 'sibbie';
	}

  if (file == '/sbemail77.html') {
	wikiPage = 'suntan';
	}

  if (file == '/sbemail78.html') {
	wikiPage = 'anything';
	}

  if (file == '/sbemail79.html') {
	wikiPage = 'the_process';
	}

  if (file == '/sbemail80.html') {
	wikiPage = 'stunt_double';
	}

    var div = document.createElement("div");
	
	a.href = "http://www.hrwiki.org/index.php/" + wikiPage;
	a.appendChild(document.createTextNode('HRWiki article'));
	div.appendChild(a);
	div.setAttribute("style", "text-align: left; left: 1px; bottom: 1px; background-color: white; padding: 2px 5px; position: absolute; z-index: 100;");
	document.body.insertBefore(div, document.body.firstChild);
  }
    
)();