// ==UserScript== // @name Obsidian Wings Pie Filter // @namespace http://ok-cleek.com // @description Turns trolls into advocates for delicious pie! // @include http://obsidianwings.blogs.com/* // @version 1.0.1 // @grant GM.xmlHttpRequest // ==/UserScript== /*------------------------------------------------------*/ // this is the stuff you can edit /*------------------------------------------------------ the bad guys. if you want to edit your list by hand, you can do it here. ex: var baddies = new Array("bad guy 1", "BADGUY2", "someone else"); by default, this is empty because you can now add baddies directly from the web page. ------------------------------------------------------*/ var baddies = new Array(); // how to abuse the comment: // 0 = replace text with big white-on-black "REDACTED" (see redactedText. below) // 1 = make them tell you how much they love pie var abuseStyle = 1; // set this to true, to knock out the "Share This" gadgets var noShareThingy = true; // contact ok-cleek.com to load additional pie messages ? // set to false if you don't trust me. // turning this off may also speed-up rendering, since you don't // have to talk to my server before drawing the page. but then you'll // be stuck with the same old pie messages... var dynamicPieText = true; var redactedText = " REDACTED "; // don't edit below here unless you know what you're doing! /*------------------------------------------------------*/ var ambientPieListName = "cleeksOWPieList"; var pieFilterHome = "http://ok-cleek.com/blogs/?page_id=25541"; var redactedTextArrayBuiltIn = new Array( "Gosh, you know, I really like pie.", "It's pie for me, guys!", "All I really know for sure is that nothing picks me up like a nice piece of pie.", "Pie? You bet!", "I think that pie may be one of the best foods we have.
No, wait, the best food we have.", "Me, when I'm feeling down, I like some pie.", "I don't know about all this stuff, guys, but I do know that I like pie.", "Who can argue with pie? Not me.", "That all may be so, but I notice that you didn't say anything about pie.", "Peach, strawberry, apple, blueberry, pecan, even mincemeat, they're all damned good. Because they're pies.", "It may look like I talk about pies a lot, but I'm actually restraining myself from bringing them up more often. They're that good!", "Pie. Pie. Pie. Pie.
Ever notice how totally great that word sounds?", "That's great. Anyone have any pie?", "That's total crap. My mother made the best apple pie.", "I just ate some pie, and darned if I don't want some more already.", "I'd just like to say that I agree with all the positive comments made about pie. It's a pleasure being around commenters who have their heads on straight and really know what pie is all about.", "Excuse the language, but goddamn! Pie is good!", "When all is said and done, pie is still excellent.", "Churchill liked pie, you know. And not that Ward guy. The other one, the British guy, he liked pies.", "I'm not really sure why I like pies so much. The roundness? The delicious crust? I dunno, man, I dunno.", "I like pie. A lot.", "Pies suck!
Ha ha, I'm joking, of course. Pies RULE!!",
"You guys don't mention pie enough.",
"For God loves us so, he gave us pie.",
"Imagine a world without pie. Sad, isn't it?",
"OT: Pie!",
"Getting back on topic: Pie is not only delicious, it's round, too!",
"I thought we were talking about pie?",
"You can have your cakes, petit fors, and tarts. For me it's pie, or nothing at all!",
"Your comment reminds me, I could really use some pie!",
"If we're not talking about pie, I don't want any part of it.",
"I don't want to live in a world without pie.",
"Q: What's round, brown and full of hot steamy goodness? " +
pieText +
"
A: PIE!",
"So, if it comes to that, and I'm not saying it will, but if it does, what about the pie?",
"I think you misunderstand; I'm really talking about pie.",
"Pie!",
"Give me pie lots of pie / 'neath the starry skies above / Don't fence me in - without pie, that is.",
"I pledge allegiance to pie!",
"Ever see \"American Pie\"? That's how much I like pie.",
"What's hot, moist, and crusty around the edges? Pie!",
"It doesn't always have to be steamy you know. Some cold pies can be excellent as well!",
"In the beginning, there was pie. Praise Jesus!",
"This is a fascinating topic, but I have to go now. The pie is ready.",
"The sad part is that this entire controversy could end right here, if we could all sit down and share some pie!",
"PIE! I EAT IT!",
"You can learn more about pie, here!",
"Bottom-crust-only pies may be known as tarts or tartlets.",
"\"Pieing\" can result in injury to the target and assault or more serious charges against the pie throwers. Don't throw pies!",
"Whether or not what we experienced was an According to Hoyle miracle is insignificant. What is significant is that I smelled pie. Pie was involved.",
"Pie is the cornerstone of any nutritious breakfast.",
"Your ideas intrigue me. Would you care to discuss them with me over pie?",
"Sweet Home Alabama but I could use me some pie!",
"Remember Warrant? That was a good band. Any band with a song about pie knows what's important."
);
///////////////////////////////////
getAmbientNames();
var redactedTextArray = redactedTextArrayBuiltIn;
if (dynamicPieText)
{
// async call to ok-cleek.com to get additional pie text
GM.xmlHttpRequest({
method: 'GET',
url: 'http://ok-cleek.com/stuff/pie_strings.json',
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'application/atom+xml,application/xml,text/xml',
},
onload: function(responseDetails)
{
if (responseDetails.status == 200) // 200 = HTTP success
{
// parse them
var redactedTextArrayJSON = JSON.parse(responseDetails.responseText);
// append them to the builtins
redactedTextArray = redactedTextArrayBuiltIn.concat(redactedTextArrayJSON);
}
// if that failed, we'll just use the builtins. no big deal.
replaceText();
}
});
}
else
{
replaceText();
}
addPieControls();
///////////////////////////////////
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
return this.replace(/\s+$/,"");
}
function GetFirstChildOfType(parent, type)
{
if (parent != null)
{
for (var i=0;i