Random comic button (Greasemonkey script)

TheAmazingOneTheAmazingOne Registered User new member
Hey guys. Yesterday I made the following greasemonkey script. It adds a "Random" link under all the buttons that are normally beneath a Penny Arcade comic, which (unsurprisingly) links to a random comic. I don't know if something like this has been done before, but if not, I thought some of you might enjoy that functionality.
// ==UserScript==
// @name Penny Arcade Random Button
// @namespace pennyarcade@random.button
// @description Adds a random comic button to penny-arcade.com
// @include http://*penny-arcade.com/comic*
// ==/UserScript==

   method: 'GET',
   url: 'http://www.penny-arcade.com/archive/',
   onload: function(responseDetails) {
      var parser = new DOMParser();
      var xmlDoc = parser.parseFromString(responseDetails.responseText,"application/xml");
      var comics = xmlDoc.getElementById('id_comic');
      var n = comics.options.length;
      var myLink=comics.options[Math.floor(Math.random()*n)].value;
      var btns = document.forms[0].parentNode;
         var newElement = document.createElement('a');

Installation instructions:
1. You will need to be using Firefox to use this script
2. If you have never added the Greasemonkey add-on, add it here.
3. Copy the code above and save it to a file on your hard drive called "penny_arcade_random.user.js"
4. In Firefox, go to File > Open file... and open the file you just created. Greasemonkey will prompt you to install the script.

Let me know if there are any problems.


TheAmazingOne on


  • Options
    DadouwDadouw Registered User regular
    edited October 2008

    Dadouw on
  • Options
    OrikaeshigitaeOrikaeshigitae Registered User, ClubPA regular
    edited October 2008
    this is cool! a slightly better place would be Tube's Circus, so I'm moving it there

    Orikaeshigitae on
  • Options
    the cheatthe cheat Registered User, ClubPA regular
    edited October 2008
    that is cool, but >.>

    think you could make a script to make double clicking a thread's blue dot mark the thread as read?

    the cheat on
  • Options
    WillethWilleth Registered User regular
    edited October 2008
    Just to skip a step, I've hosted this for people at http://www.willeth.com/penny_arcade_random.user.js so all you need to do is click that link and Greasemonkey will prompt an install.

    This works pretty well, but is there a way you could add a button and maybe one for the news posts?

    Willeth on
    @vgreminders - Don't miss out on timed events in gaming!
    @gamefacts - Totally and utterly true gaming facts on the regular!
Sign In or Register to comment.