I'm looking to create a Greasemonkey script that will replace Facebook thumbnails in InoReader or any other RSS reader. Previously I had been successfully using the script below in Google Reader, but it doesn't work in InoReader, Feedly, or any non-Google RSS Reader.
// ==UserScript==
// @id greader-facebookurlreplacer
// @name Google Reader - Facebook URL Replacer
// @version 1.1
// @namespace
// @author
// @description
// @include https://www.google.com/reader/*
// @include https://www.feedspot.com/*
// ==/UserScript==
document.getElementById("chrome").addEventListener("DOMNodeInserted", function (e) {
if (e.target.tagName && e.target.tagName == "DIV" && /entry\s?/.test(e.target.className)) {
var t = e.target.getElementsByTagName("img");
for (var n in t) {
var r = t[n];
if (/.*akamaihd\.net.*_s\.\w+$/.test(r.src)) {
r.style.width = r.style.height = "inherit";
r.src = r.src.replace(/_s\.(\w+)$/, "_n.$1")
}
}
}
}, false)
I also tried using the following code retrieved from a similar post on stackoverflow, but it doesn't work either in InoReader.
$("img[src^='https://fbcdn-photos-a.akamaihd.net']")
.each(function()
{
this.src = this.src.replace(/(\/[^/]*)s\.jpg$/, '/s720x720$1n.jpg');
});
Any help would be greatly appreciated.