Created
May 14, 2015 14:25
-
-
Save tarockx/e089acce5f1141e6efeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FineGentleMan(anyone) for GreaseMonkey/TamperMonkey by The_Leaf | |
// @namespace com.nfohump.theleaf.ignorescript | |
// @description Give some class to your ignored users' posts. | |
// @include *://*.nfohump.com/* | |
// @version 1 | |
// @grant GM_xmlhttpRequest | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js | |
// ==/UserScript== | |
function processPage() { | |
var posts = $('div[id=userprofile] span[class=postdetails] div[id=userav] i:contains("Ignored")'); | |
posts.each(function () { | |
var smpost = $(this).parent().closest('tr'); | |
var pcontent = $(smpost).find('div[class=userPost]'); | |
GM_xmlhttpRequest({ | |
method: 'GET', | |
url: 'http://www.iheartquotes.com/api/v1/random?max_lines=10&source=literature&show_permalink=false&show_source=false', | |
onload: function (response) { | |
if(response.status == 200){ | |
$(pcontent).html('<span class="postbody">' + response.responseText.replace(/(?:\r\n|\r|\n)/g, '<br />') + '</span>'); | |
} | |
} | |
}); | |
}); | |
} | |
console.log('Testing'); | |
processPage(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment