Skip to content

Instantly share code, notes, and snippets.

@giiska
Last active August 29, 2015 14:03
Show Gist options
  • Save giiska/ab04ecca2569ddf6c2fd to your computer and use it in GitHub Desktop.
Save giiska/ab04ecca2569ddf6c2fd to your computer and use it in GitHub Desktop.
UserScript
// ==UserScript==
// @name socialbase content list replace url
// @namespace http://use.i.E.your.homepage/
// @version 0.1.1
// @description enter something useful
// @match http://socialbase.hk/socialbase/content/*
// @copyright 2014+, bammoo
// ==/UserScript==
require(['jquery'], function($) {
setTimeout(function() {
console.log('socialbase content list replace preview url');
$('a[href^="http://api.socialbase.cn/extapi/"]').each(function(idx, item) {
var href = $(item).attr('href').replace('api.socialbase.cn', 'socialbase.hk');
$(item).attr('href', href);
})
}, 5000)
})
// ==UserScript==
// @name socialbase weimenhu
// @namespace http://use.i.E.your.homepage/
// @version 0.1.2
// @description enter something useful
// @match http://socialbase.hk/weimenhu/zbbb/*
// @copyright 2014+, bammoo
// ==/UserScript==
require(['jquery'], function($) {
var replaceName = 'zbbb'
, timeOut = 2000
;
setTimeout(function() {
console.log('start weimenhu name replace');
$('a[href^="http://' + replaceName + '.socialbase.hk/weimenhu/"]').each(function(idx, item) {
var href = $(item).attr('href').replace(replaceName + '.', '');
$(item).attr('href', href);
})
}, timeOut)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment