Author |
Topic: Help with Greasemonkey (Read 839 times) |
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Help with Greasemonkey
« on: Sep 9th, 2007, 9:48pm » |
Quote Modify
|
I have learnt a bit of Greasemonkey scripting. I would like to finally write a greasemonkey script for multiple quotes as discussed in one of the earlier threads. But thats quite a bit in the future for me. Before that, to start off, i am trying to write a small greasemonkey script for ignoring users on this forum (the attempt is to not display the posts of that particular user). I just thought it might be a fun project to start with. I was just viewing the source of the generated pages in wu forum and i realise that 1. i will have to find the anchor tag that has "username=<user>" 2. Go 3 tables up and ignore those tables. Doing 1 is quite easy. I am not sure i have seen an example of 2 yet. Any ideas would be greatly appreciated. -- AI
|
|
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
Sameer
Uberpuzzler
Pie = pi * e
Gender:
Posts: 1261
|
|
Re: Help with Greasemonkey
« Reply #1 on: Sep 9th, 2007, 10:33pm » |
Quote Modify
|
Oh my gosh!!! I was just thinking of this today and was googling around if there was any script to do so!! Please do this ASAP... I think lot of us needs it!!
|
|
IP Logged |
"Obvious" is the most dangerous word in mathematics. --Bell, Eric Temple
Proof is an idol before which the mathematician tortures himself. Sir Arthur Eddington, quoted in Bridges to Infinity
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Help with Greasemonkey
« Reply #2 on: Sep 9th, 2007, 11:49pm » |
Quote Modify
|
For the selected table (element) set style.display='none'; Or, if you still want to see there was a post there style.visibility='hidden';
|
« Last Edit: Sep 9th, 2007, 11:50pm by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
A basic version is ready, which removes posts of a "particular" user at the moment. Its very basic and simple (i mean its hardly 10 lines of code) at the moment. Lot of improvements are possible and i will try to gradually add them to the script. I am attaching the script with this post. So, you can get some immediate relief, if you catch my drift. -- AI P.S -> Remove the txt extension
|
« Last Edit: Sep 10th, 2007, 1:13am by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Help with Greasemonkey
« Reply #4 on: Sep 10th, 2007, 1:24am » |
Quote Modify
|
on Sep 9th, 2007, 11:49pm, towr wrote:For the selected table (element) set style.display='none'; Or, if you still want to see there was a post there style.visibility='hidden'; |
| Thats a good idea. Infact, i think i should be able to attach a button, where will allow you to see a particular removed post on click. By default, we can keep them hidden. Though, i am not particularly sure of how i am going to do that with greasemonkey, unless it allows me add custom java scripts to the HTML page. -- AI P.S -> I need ideas though on dynamic addition of ignored users, without manually rewriting script every time. Is it possible to do with greasemonkey?
|
« Last Edit: Sep 10th, 2007, 1:27am by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: Help with Greasemonkey
« Reply #5 on: Sep 10th, 2007, 1:45am » |
Quote Modify
|
on Sep 10th, 2007, 1:24am, TenaliRaman wrote:i am not particularly sure of how i am going to do that with greasemonkey, unless it allows me add custom java scripts to the HTML page. |
| There are ways to do that. I think it's used in the math symbol userscript as well. So you could dig around in that code for inspiration. Quote:I need ideas though on dynamic addition of ignored users, without manually rewriting script every time. Is it possible to do with greasemonkey? |
| Aside from using cookies, I doubt it. You'd have to make a proper firefox extension.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Eigenray
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 1948
|
|
Re: Help with Greasemonkey
« Reply #6 on: Sep 10th, 2007, 2:34am » |
Quote Modify
|
Use GM_setValue and GM_getValue. These variables will appear in about:config under greasemonkey.scriptvals.<namespace>/<name>.<key>
|
|
IP Logged |
|
|
|
SMQ
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 2084
|
|
Re: Help with Greasemonkey
« Reply #7 on: Sep 10th, 2007, 5:04am » |
Quote Modify
|
However, the GM_* functions only work under Firefox/NS9 with Greasemonkey; they're not portable to IE, Safari, etc. if that's a consideration. --SMQ
|
|
IP Logged |
--SMQ
|
|
|
Sameer
Uberpuzzler
Pie = pi * e
Gender:
Posts: 1261
|
|
Re: Help with Greasemonkey
« Reply #8 on: Sep 10th, 2007, 9:20am » |
Quote Modify
|
Small question!! I am not good with this, so how do I go about using it? And by the way you want to actually not use the "actual" username in your attached script just to be politically correct!!
|
|
IP Logged |
"Obvious" is the most dangerous word in mathematics. --Bell, Eric Temple
Proof is an idol before which the mathematician tortures himself. Sir Arthur Eddington, quoted in Bridges to Infinity
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
I bring to thee my super duper grease monkey script......... Ok its not super duper, its a tad bit nicer than the earlier version. It will allow you to see some of the removed posts and if you still feel yucky, you can hide them back. on Sep 10th, 2007, 9:20am, Sameer wrote:Small question!! I am not good with this, so how do I go about using it? |
| 1. Remove the txt extension of the file. [edit]The forum software has renamed the file, the filename should something like <ignore_the_idiots>.js[/edit] 2. If you dont have firefox, get firefox. 3. Install greasemonkey add-on for the firefox. (Greasemonkey-like softwares do exist for other browsers, but i dont know how well my script works in other browsers) 4. Open my super duper greasemonkey script in firefox. Greasemonkey will ask you whether you want to install this uber script. Click on "yes"(you have no option). Quote:And by the way you want to actually not use the "actual" username in your attached script just to be politically correct!! |
| Oh, that name is just a test example. Replace that with anything you may wish. -- AI
|
« Last Edit: Sep 10th, 2007, 10:54am by TenaliRaman » |
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
TenaliRaman
Uberpuzzler
I am no special. I am only passionately curious.
Gender:
Posts: 1001
|
|
Re: Help with Greasemonkey
« Reply #10 on: Sep 10th, 2007, 11:11am » |
Quote Modify
|
on Sep 10th, 2007, 2:34am, Eigenray wrote: Hey, neat idea. I will give it a try. on Sep 10th, 2007, 5:04am, SMQ wrote:However, the GM_* functions only work under Firefox/NS9 with Greasemonkey; they're not portable to IE, Safari, etc. if that's a consideration. |
| Well, its worth a shot. People can use whichever works for them. Though, they will be losing out on some functionality. (Note : People who maybe expecting this super-duper-reloaded script, dont hold your breath. I am not sure, i can even finish it ) on Sep 10th, 2007, 1:45am, towr wrote:Aside from using cookies, I doubt it. You'd have to make a proper firefox extension. |
| Hmm, would have to look at the APIs. If its easy to do as it is in greasemonkey, i might just give it a shot. (Though, i am not particularly sure how my boss would feel about it ) -- AI
|
|
IP Logged |
Self discovery comes when a man measures himself against an obstacle - Antoine de Saint Exupery
|
|
|
|