Greasy Fork is available in English.

Обговорення » Розробка

Any idea why my filmot script stopped working in the past recent weeks?

§
Опубліковано: 17.07.2015

Any idea why my filmot script stopped working in the past recent weeks?

For the past couple of days it seems like my imgur>filmot script stopped working and not sure if this was due to a reddit update or imgur update or maybe it's a conflict with RES?

// ==UserScript==
// @name redgur2
// @namespace reddit
// @description Changes imgur.com links to filmot.com
// @include https://reddit.com/*
// @include https://www.reddit.com/*
// ==/UserScript==

var anchors = document.getElementsByTagName('a');
for (var i = 0; i < anchors.length; ++i)
{
var a = anchors[i];
if (a.href && a.href.indexOf('https://imgur.com/') == 0)
{
a.href = a.href.replace('https://imgur.com/', 'https://filmot.org/');
}
if (a.href && a.href.indexOf('https://i.imgur.com/') == 0)
{
a.href = a.href.replace('https://i.imgur.com/', 'https://i.filmot.org/');
}
if (a.href && a.href.indexOf('https://m.imgur.com/') == 0)
{
a.href = a.href.replace('https://m.imgur.com/', 'https://filmot.org/');
}
if (a.href && a.href.indexOf('http://imgur.com/a/') == 0)
{
a.href = a.href.replace('https://imgur.com/a/', 'https://filmot.org/a/');
}
}

woxxomMod
§
Опубліковано: 17.07.2015
Edited: 17.07.2015
// ==UserScript==
// @name        redgur2
// @version     2.0
// @namespace   reddit
// @description Changes imgur.com links to filmot.com
// @include     https://reddit.com/*
// @include     https://www.reddit.com/*
// @include     http://reddit.com/*
// @include     http://www.reddit.com/*
// @run-at      document-end
// ==/UserScript==

[].forEach.call(document.querySelectorAll('a[href*="imgur.com/"]'), function(a) {
  a.href = a.href.replace(/https?:\/\/(m\.)?(i\.)?imgur\.com/, "https://$2filmot.org");
});
§
Опубліковано: 17.07.2015

Ah thanks! it works, but looks like they blocked filmot.org =( and .com

Опублікувати відповідь

Sign in to post a reply.