Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: Kraken Kratom Red Vein Kratom   PhytoExtractum Maeng Da Thai Kratom Leaf Powder   Myyco.com Golden Teacher Liquid Culture For Sale

Jump to first unread post Pages: 1
Offlinechibiabos
Cosmic Pond Scum
I'm a teapot User Gallery


Registered: 03/16/17
Posts: 4,180
Last seen: 1 year, 1 month
Useless Greasemonkey Script * 1
    #24743732 - 10/28/17 03:29 PM (6 years, 5 months ago)

I promised akira that I'd kludge up a userscript to change all of his post text (on my browser) to read "Autistic screeching."  So I spent way too  much time on this thing, (which you could honestly just change to target whatever user you want to, since it grabs stuff based on UID).

Code:
// ==UserScript==
// @name Autistic Screeching
// @namespace https://www.shroomery.org/*
// @include https://www.shroomery.org/forums/showflat.php/Number/*
// @version 1
// ==/UserScript==

var i;

var table_rows = document.getElementsByClassName('tableborders')[3].getElementsByTagName('tr');

for(i = 0; i < table_rows.length; i++){
var j = 0;
var anchors = table_rows[i].getElementsByTagName('a');
if(anchors.length > 0){
for(j = 0; j < anchors.length; j++){
var anchor_title = anchors[j].getAttribute('title');
if(anchor_title == "Member # 212565"){
table_rows[i+3].getElementsByClassName('post')[0].innerHTML = "Autistic Screeching.";
}
}
}
}


Edited by chibiabos (10/28/17 03:39 PM)

Extras: Filter Print Post Top
Offlinechibiabos
Cosmic Pond Scum
I'm a teapot User Gallery


Registered: 03/16/17
Posts: 4,180
Last seen: 1 year, 1 month
Re: Useless Greasemonkey Script [Re: chibiabos]
    #24744258 - 10/28/17 08:44 PM (6 years, 5 months ago)

Fixed it up, a little bit.

Code:
// ==UserScript==
// @name Autistic Screeching
// @namespace https://www.shroomery.org/*
// @include https://www.shroomery.org/forums/showflat.php/Number/*
// @version 1.2
// ==/UserScript==

var i;

var table_rows = document.getElementsByClassName('tableborders')[3].getElementsByTagName('tr');

for(i = 0; i < table_rows.length; i++){
var j = 0;
var anchors = table_rows[i].getElementsByTagName('a');
if(anchors.length > 0){
for(j = 0; j < anchors.length; j++){
var anchor_title = anchors[j].getAttribute('title');
if(anchor_title == "Member # 212565"){
var post_elems = table_rows[i+3].getElementsByClassName('post');
post_elems[0].innerHTML = "Autistic screeching.";
var block_quotes = table_rows[i+3].getElementsByTagName('blockquote');
while(block_quotes.length > 0){
block_quotes[0].parentNode.removeChild(block_quotes[0]);
}
while(post_elems.length > 4){
post_elems[1].parentNode.removeChild(post_elems[1]);
}
}
}
}
}


Extras: Filter Print Post Top
InvisibleDieCommie

Registered: 12/11/03
Posts: 29,258
Re: Useless Greasemonkey Script [Re: chibiabos]
    #24745147 - 10/29/17 09:56 AM (6 years, 5 months ago)

Browsing experience change much at all?

Extras: Filter Print Post Top
Offlinechibiabos
Cosmic Pond Scum
I'm a teapot User Gallery


Registered: 03/16/17
Posts: 4,180
Last seen: 1 year, 1 month
Re: Useless Greasemonkey Script [Re: DieCommie]
    #24745362 - 10/29/17 11:43 AM (6 years, 5 months ago)

I now live in a fantasy where akira actually says what's on his mind.  :shrug:

Extras: Filter Print Post Top
Offlinechibiabos
Cosmic Pond Scum
I'm a teapot User Gallery


Registered: 03/16/17
Posts: 4,180
Last seen: 1 year, 1 month
Re: Useless Greasemonkey Script [Re: chibiabos]
    #24767301 - 11/07/17 06:30 PM (6 years, 5 months ago)

Updated the script a little bit.  Now it works whether or not you're logged in.

Code:
// ==UserScript==
// @name Autistic Screeching
// @namespace https://www.shroomery.org/*
// @include https://www.shroomery.org/forums/showflat.php*Number*
// @version 1.3
// ==/UserScript==


function main(){
var i;
var table_borders = document.getElementsByClassName('tableborders');
var table_rows;
//Get table rows that are children of whatever element of the class "tableborders" contains
//peoples' posts.
//
//Conditional statement in case I'm logged in.
if (table_borders[0].innerHTML.includes("Welcome")){
table_rows = table_borders[2].getElementsByTagName('tr');
} /*Conditional in case I'm a guest.*/ else{
table_rows = table_borders[3].getElementsByTagName('tr');
}

//Check each entry in table_rows to look for posts by Akira
for(i = 0; i < table_rows.length; i++){
var j = 0;
//Create a list of anchors and check them for akira's uid.
var anchors = table_rows[i].getElementsByTagName('a');
if(anchors.length > 0){
for(j = 0; j < anchors.length; j++){
var anchor_title = anchors[j].getAttribute('title');
/*If a title attribute mathces akira's uid then replace the text in <font class="post"></font>
* with "Autistic screeching."*/
if(anchor_title == "Member # 212565"){
// Debugging stuff.
// alert(table_rows[i+3].getElementsByClassName('post')[0].innerHTML);
var post_elems = table_rows[i+3].getElementsByClassName('post');
//alert(post_elems.length); //Debugging stuff
post_elems[0].innerHTML = "Autistic screeching.";
/*Find blockquotes and get rid of those, for prettiness.*/
var block_quotes = table_rows[i+3].getElementsByTagName('blockquote');
while(block_quotes.length > 0){
block_quotes[0].parentNode.removeChild(block_quotes[0]);
}
while(post_elems.length > 4){
post_elems[1].parentNode.removeChild(post_elems[1]);
}
}
}
}
}
}

main();



Extras: Filter Print Post Top
Offlinechibiabos
Cosmic Pond Scum
I'm a teapot User Gallery


Registered: 03/16/17
Posts: 4,180
Last seen: 1 year, 1 month
Re: Useless Greasemonkey Script [Re: chibiabos]
    #24767310 - 11/07/17 06:35 PM (6 years, 5 months ago)

Also wrote this, to delete post scores from Reddit pages.  Skinner boxes and whatnot...

I'm sure that I could do this without writing in a function call for each class name, but whatever.

Code:
// ==UserScript==
// @name Delete Post Scores
// @namespace reddit.com
// @include https://www.reddit.com/*
// @version 1.0
// ==/UserScript==



function main(){
var path = location.pathname;
var div_elems;
var score_elems, score_length;
var i;


if(path.includes("/user/")){
div_elems = document.getElementById('siteTable').getElementsByTagName('div');
} else if(path.includes("/r/")){
div_elems = document.getElementsByClassName('sitetable nestedlisting')[0].getElementsByClassName('tagline');
}
var num_divs = div_elems.length;

for(i=0;i<num_divs;i++){
if(i == 0){
function remove_score(limit){
var j;
for(j=0;j<limit;j++){
score_elems[j].parentNode.removeChild(score_elems[j]);
}
}
}

score_elems = div_elems[i].getElementsByClassName('score likes');
score_length = score_elems.length;

remove_score(score_length);

score_elems = div_elems[i].getElementsByClassName('score unvoted');
score_length = score_elems.length;

remove_score(score_length);

score_elems = div_elems[i].getElementsByClassName('score dislikes');
score_length = score_elems.length;

remove_score(score_length);

}
}

main();


Extras: Filter Print Post Top
Jump to top Pages: 1

Shop: Kraken Kratom Red Vein Kratom   PhytoExtractum Maeng Da Thai Kratom Leaf Powder   Myyco.com Golden Teacher Liquid Culture For Sale


Similar ThreadsPosterViewsRepliesLast post
* help with a script
( 1 2 all )
supra 2,104 20 11/27/08 02:13 PM
by zouden
* linux shell script help OJK 986 7 05/23/06 12:21 PM
by OJK
* Good php scripts? Murex 572 1 01/14/04 06:19 PM
by nife
* Flash Script Help p4kSouL 373 0 10/03/05 11:45 AM
by p4kSouL
* Scripting Languages: Ruby vs. Python Evolving 1,178 8 02/14/04 08:57 PM
by djfrog
* FREE ASP SCRIPT SITES? Fliquid 836 5 09/23/03 09:31 AM
by Fliquid
* script for uploading to ftp server through browser interface sherm 833 5 02/11/09 01:28 PM
by blink
* Suspicious Script: rollback.js question_for_joo 556 1 09/05/04 06:57 PM
by psyka

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
515 topic views. 0 members, 0 guests and 0 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.019 seconds spending 0.006 seconds on 14 queries.