35 Comments
- rickysilk, on 10/12/2007, -1/+14I'm really not a jerk but... http://digg.com/search?search=diveintogreasemonkey
- bmschech, on 10/12/2007, -1/+10Save your knee-jerk cynicism. The book is generously offered free on his site in several formats. It's the best thing I've found so far on the web for learning about greasemonkey. More people should know about this great book and amazing extension. So hat's off to Mark and a sincere digg!
- uzusan, on 10/12/2007, -0/+8This is an old link, but still useful. dive into greasemonkey has been one of the foremost resources on greasemonkey scripting and the more people who know about it the better.
- LouCypher, on 10/12/2007, -0/+7This is very old news. Almost a year.
However, Mark Pilgrim (the author) is planning to update it.
http://mozdev.org/pipermail/greasemonkey/2006-March/007903.html - nograz, on 10/12/2007, -0/+7Dive Into Greasemonkey has been around for a long time, it is one of the many sites I first hit when I was asked to create a gm script. What I set out to do is create a script that would add links into a message board, links to what we use as a sub message board that is away from the main one.
It started out simply, it just put extra links by each post. I then added features, for example, when you were in a post it would check to see if there was a corrisponding post on the sub board. Due to server strain, we cannot check every single post in the main listing, as the boards get refreshed too much. So I am currently working on loading an array and using the script to check each post to take a load off of the server. I am also working on a set of tools to be able to post and see the sub board in the main window with out opening a new one. The list is a little longer, but nothing too important.
I have since switched from GM to a straight Firefox Exention though. There are some GM compilers, that will take your GM script and convert it into an exention for you. I started with that, but I have since moved to writing an extension from scratch.
I also am working on a ignore extension, that started as a GM script, with a bunch of useful features. - LDaVinci, on 10/12/2007, -0/+3Another thing about Greasemonkey.
To change de "Editor Program" Greasemonkey uses to edit the scripts, I configured the notepad from Windows, then I founded out about notepad plus ( http://sourceforge.net/projects/notepad-plus ) so I needed to change it.
To do so, you have to go to the: about:config in FF
then search for the greasemonkey.editor field and reset it.
Then, when you try to edit another script it will ask you to enter the program to do so. - LKBM, on 10/12/2007, -0/+3Sure: Use the XPath to find all the stories, pass String.match('grease monkey') over each one's content, and then do an XMLHttpRequest on the digging URL for each mathing story.
- jeolmeun, on 10/12/2007, -1/+4http://platypus.mozdev.org/
- LouCypher, on 10/12/2007, -0/+3http://userscripts.org/tags/digg
- stutteringstan, on 10/12/2007, -0/+3For example, if you want to hide class=ad, try try this:
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('.ad { display: none ! important; }'); - Rice, on 10/12/2007, -0/+2GPL books are awesome, indeed.
- zonemen, on 10/12/2007, -0/+2Just a question about writing Greasemonkey scripts, how do you remove a div or img element on a page if it has no id?
- natch, on 10/12/2007, -0/+2Unfortunately Platypus seems to no longer work starting with Firefox 1.5.0.1. It won't install, and says it only works on newer versions of Firefox up to 1.5. The Platypus FAQ is silent on this issue, even though 1.5.0.1 has been out for quite some weeks now. So... time to dive into Greasemonkey directly then.
- nograz, on 10/12/2007, -0/+2I do something like that in a script I wrote, though instead of deleting tags with out ids. I actually add tags when the ids and classes are the same and I don't want to change them all.
I guess I may have answered your question, if the divs have a class that is unique, you can use that. Otherwise, I use regex to find locate the position where I need to take care of stuff.
XPath is another must to learn to use with your greasemonkey script. XPath is by far more powerful than the standard javascript set of functions. - srt19170, on 10/12/2007, -0/+2If you want the power of Greasemonkey without having to learn Javascript programming, try Platypus http://platypus.mozdev.org, which provides a GUI for creating GM scripts.
- jeolmeun, on 10/12/2007, -0/+2Screenshots at http://jeolmeun2.blogspot.com/2006/03/digg-link-and-highlight-your-comments.html
- jeolmeun, on 10/12/2007, -0/+2If you want a Greasemonkey userscript to tryout with digg, there's http://digg.com/software/digg_Link_and_Highlight_Your_Comments which will display a list of links to your yellow highlighted digg comments.
There's also http://userscripts.org/ which will host your userscripts for free. - LDaVinci, on 10/12/2007, -0/+2You have to install the version 0.64 (the link is under "Releases"). That works on FF 1.5.0.1.
- thewayner, on 10/12/2007, -1/+2The original site, the best site. Gotta love the greasemonkey
- inactive, on 10/12/2007, -0/+1HTML elements with no id can be accessed as elements of an array.
If you have
you could use document.images[2] in order to access the third image tag.
As for accessing a div with no id, I'm sure div must be an element of an array but I don't know off the top of my head exactly what it is, anyone else know? - LouCypher, on 10/12/2007, -0/+1@stutteringstan: GM 0.6.4 already has API to add styles
GM_addStyle(css); - ThirdPrize, on 10/12/2007, -1/+2Mmmmm ... greased monkeys!
- xpose, on 10/12/2007, -0/+1greasemonkey is one of the best extensions you can get. good link, ive been curious to learn . ..
- tommasz, on 10/12/2007, -1/+2Mark is in the progress of updating this to accomodate the API changes that came about for security reasons. I'd recommend holding off grabbing this until he completes them. There's enough different that many scripts won't work if not modified. It's free for download, no purchase required.
- tablatronix, on 10/12/2007, -0/+1heh
Thats plain html, thats what html was created for
Thats also what its supposed to look like. - drgalaxy, on 10/12/2007, -0/+1Yay for Mark Pilgrim!
- paulwesterberg, on 10/12/2007, -0/+1Greasemonkey is very easy to learn because you can usually find an existing script and modify it to suit you. For example I got tierd of all the new adverting added to the nytimes recently so I checked out a few ad blocking scripts from:
http://www.userscripts.org
And after some copy-n-paste & some trial-n-error I cobbled together my own custom script for the nytimes website and now you can use it for free:
http://www.userscripts.org/scripts/show/2476 - munkt0n, on 10/12/2007, -11/+12http://007google.com/*****%20off%20with%20the%20007google%20links%20already.aspx
- AlN1, on 10/12/2007, -0/+1one of my favorite computer books of all time.. Greasemonkey Hacks, also written by Mark Pilgrim. So many great examples. Greasemonkey rules!
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?z=y&isbn=0596101651
the greasemonkey folks also maintain a very good forum where many graciously offer code examples.
http://www.mozdev.org/pipermail/greasemonkey/ - thatguy2g, on 10/12/2007, -0/+1Just do document.getElementsByTagName('img'), or document.getElementsByTagName('div'). It will return an array of all elements with those tag names. You can then loop trough that array until you find the one you want to remove (weather it be by looking at the image's src property, or whatever...).
- techlinks, on 10/12/2007, -1/+2I just stumbled upon this yesterday, boy am I glad I did!
- dotnetguy, on 10/12/2007, -0/+1Try the Platypus extension.
http://platypus.mozdev.org/
Platypus is a Firefox extension which lets you modify a Web page from your browser -- "What You See Is What You Get" -- and then save those changes as a Greasemonkey script so that they'll be repeated the next time you visit the page. Editing pages to suit your needs is dandy -- but making those changes "permanent" is the real payoff. - istok, on 10/01/2008, -0/+0You can conquer the world with Greasemonkey.
- tdlrali, on 10/12/2007, -3/+1this is OOOOLLLLLLLDDDDDDD!
- verucasalt, on 10/12/2007, -26/+1Oh right, this page is just about manipulating Digg readers into buying this book, just like that "Google buying Sun" manipulation to fool digg.


What is Digg?