OCAU Forums Greasemonkey scripts

Discussion in 'Programming & Software Development' started by Rezin, Jul 8, 2007.

  1. Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    These scripts are now in the Wiki

    Here are some Greasemonkey scripts for the OCAU Forums you may find useful.

    Feel free to suggest any modifications to these scripts, or a new script with features that other members may find useful too. Please note, I will not be making a script that removes or hides the ads from this site.

    If you have created any Greasemonkey scripts that can be used on the OCAU Forums I can host it with the others in a directory named after your username.

    They have been tested with the default vBulletin style and the sabretooth style. If you find any bugs in these scripts post a description of it in this thread.

    If any of these sound useful and you don't have Firefox installed it can be downloaded from the Mozilla site.
     
    Last edited: Aug 4, 2008
  2. skootyloops

    skootyloops Member

    Joined:
    Apr 29, 2006
    Messages:
    5,693
    This is great work. Installing a few of these scripts now.

    Again great work :thumbup:

    EDIT: Actually I have found a small problem. When I use the 'Highlight My Posts' script it reads ALL posts in the video card forum as my own since I have an edit button on all posts.

    Is there away to edit this script so it searches for a username instead?
     
    Last edited: Jul 8, 2007
  3. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    :lol: Bugger, didn't think of that... I don't have admin permissions and didn't realise there was an Edit button on each post. You can use the "Highlight Users" or "Highlight Users Enhanced" script instead and just specify your username.
     
  4. skootyloops

    skootyloops Member

    Joined:
    Apr 29, 2006
    Messages:
    5,693
    Ahh ok (installs that one) thanks :thumbup:
     
  5. brodsta

    brodsta Member

    Joined:
    Nov 26, 2004
    Messages:
    987
    Location:
    QLD
    Whenever I click the Search Thread and Thread Tools buttons lately they default to a panel down the bottom (Toymods forums have been doing this lately too), is this something to do with the vB version or my version of JRE perhaps? Because your thread tools extension won't work for me otherwise. o_O

    Is the thread tools menu working for everyone else?
     
  6. ojk007

    ojk007 Member

    Joined:
    Oct 28, 2006
    Messages:
    1,273
    installed now

    they look good hopefully they work well

    EDIT: Well i love they are useful, thanks
     
    Last edited: Jul 10, 2007
  7. Witch

    Witch Member

    Joined:
    Feb 21, 2006
    Messages:
    51
    Location:
    Melbourne
    I was thinking just the other day about ways to enhance my forum usage through Greasemonkey. I look forward to trying these out.

    By the way, how did you learn to make these scripts? I would like to do the same but I have been finding "Dive Into Greasemonkey" to have a very steep learning curve indeed. I think that it is meant to be read by people who already know some JavaScript, or at least some programming language theory.

    Does anyone know of any texts that start at a more basic level?

    If not, I'll just have to use my incredible powers of reasoning :lol:
     
  8. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    A good way to learn how to write these scripts is to start with the basics and just experiment and see what the results are. The "Your First User Script" tutorial on that site will give you a basic understanding of how to approach them.

    Another handy Firefox add-on is Firebug which allows you to interact with the page you are viewing and immediately see the results without switching between an editor and Firefox. This add-on also has a console which can be used to view any errors and allows you to log messages to it which helps with debugging the script while it is running.

    Here are some sites that may help:
     
  9. [Cyclops]

    [Cyclops] Member

    Joined:
    Aug 29, 2006
    Messages:
    8
    A while back, I got into some Greasemonkey scripting for another site, and realized it can actually be a good window into JavaScript. As well as Dive into Greasemonkey and the W3Schools Javascript Reference (i actually stayed out of the JS Tutorials side, and prefered the pure reference side most of the time), I also used the JS-Shell bookmarklet to test my code. The good thing about the JS-Shell is, in most cases, you can paste an entire Greasemonkey script in there, and it will actually process it. The JS-Shell also helped me while working with some proper page JS, so I really need to recommend it. Im willing to bet it is similar to the workings of Firebug (which I may check out) but I just wanted to put it out as another alternative.

    Oh, little note. Because they can work only in Firefox, you can also make use of Firefox-only features... like the extra CSS 3 settings included.

    As a small example, I decided to quickly knock together a Rounded Corners script. All it does is pick up every table element, and apply a 5px CSS3 Rounded Corner to it. It may not look to perfect on the highly-stylised pages here (backgrounds pop up over the rounding, and certain border settings play havoc with it), but it can be modified to be used on any page to slightly round the tables.
     
  10. Axe_2_gr1nd

    Axe_2_gr1nd Member

    Joined:
    Aug 3, 2002
    Messages:
    116
    Location:
    Planet fold
    oh oh, man I've Always looked for some way of being able to "Save" my post by Ctrl+enter as All my mail & Msg'r programs have had that set to the send function.

    so I'm always typeing a reply then hitting "Ctrl+ enter" and going Doh! then clicking "submit Reply".

    Is this some thing that could do that? as if so I'll start to learn how to write greasemonkey scripts.
    thanks
     
  11. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    Nice effect. :cool:

    Did you want me to host it with the rest of them in a [Cyclops] folder? I will add it to the first post and link to your copy (and also the copy on my host if you want me to add it with the rest of them). If you want it added to the first post, is this description okay - (pretty much what you've said above): "Applies the 'MozBorderRadius' CSS3 style to table elements for a rounded-corners effect".

    That's a good idea. I'll have a crack at that tonight if you like. :)
     
  12. Witch

    Witch Member

    Joined:
    Feb 21, 2006
    Messages:
    51
    Location:
    Melbourne
    Thanks Rezin & Cyclops, I'll definitely follow up on all of your suggestions.

    That sort of approach is how I prefer to learn. (Unfortunately for me most formal education uses a completely different approach that I struggle with.)

    Anyway, I now know what to look at next, so :thumbup:
     
  13. looktall

    looktall Working Class Doughnut

    Joined:
    Sep 17, 2001
    Messages:
    24,376
    i've just started using IE7 Pro which is an IE7 add-in that allows, among other things, user scripts.
    i assume these scripts would only work in FF.

    can anyone make some scripts for IE7 pro? i wouldn't have a clue how to do it. :wired:
     
  14. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    Neat, I'll have to install that later today. There are a few differences with the way Greasemonkey scripts and IE7Pro scripts are written, so these ones aren't going to work as they are. I will have a look at converting some in the next few days.
     
  15. FatBoyNotSoSlim

    FatBoyNotSoSlim Member

    Joined:
    Sep 9, 2002
    Messages:
    14,066
    Location:
    Melbourne - 3174
    Old thread, I know, but I've just started using GreaseMonkey for eBay, Amazon etc. and these OCAU ones have come in handy.

    Thanks Rezin.
     
  16. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    No worries. I'll have a couple more to add to these soon... just need to finish them off.
     
  17. FatBoyNotSoSlim

    FatBoyNotSoSlim Member

    Joined:
    Sep 9, 2002
    Messages:
    14,066
    Location:
    Melbourne - 3174
    Unless its me, or the script is old, I can't get the HighLight Users script to work.
    Running stock standard, and the values already inputted (Admins change to green name) don't appear?

    Highlight my posts works fine though.

    N.B. To edit, I right click GreaseMonkey, click manage scripts, click on the script I want, then click edit, change the stuff, save, then close greasmoney window, refresh the page?
     
  18. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    I think something funny is going on with vBulletin tonight (I didn't notice it happening earlier), although another machine here with Firefox is working fine... so?

    Can you do me a favour and open up Firefox's Error Console, clear it, and then open a thread (any one will do - showthread.php) and see if there's any errors in the console. I'm getting an error on the vbulletin_multi_quote.js JavaScript file.

    Edit: That error isn't occurring anymore after turning off my AV programs web scanner...
     
    Last edited: Oct 25, 2007
  19. FatBoyNotSoSlim

    FatBoyNotSoSlim Member

    Joined:
    Sep 9, 2002
    Messages:
    14,066
    Location:
    Melbourne - 3174
    I get 2 iterations of this error, presumably because I'm running Highlight My Posts and Highlight Users.
    Code:
    Error: document.getElementById("posts") has no properties
    Source File: file:///C:/Documents%20and%20Settings/FatBoyNotSoSlim/Application%20Data/Mozilla/Firefox/Profiles/gyvvskp2.default/extensions/%7Be4a8a97b-f2ed-450b-b12d-ee082ba24781%7D/components/greasemonkey.js
    Line: 341
    EDIT: Just realised this was on a page with little content, it was the No Newer Threads page, a page with a post by Agg, shows no relevant errors.

    EDIT2: Enhanced version works fine. Yay for finding a bug :)
     
    Last edited: Oct 25, 2007
  20. OP
    OP
    Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    The Highlight Users Enhanced script works, so I'll have a quick look at the other two now... but it might have to wait until later today if it's not an obvious fix.

    Edit: Highlight My Posts is working for me. If you're running them both together, it will be the Highlight Users script that is tripping the other one.
     

Share This Page