Skip to content

Instantly share code, notes, and snippets.

@solar
Created February 4, 2015 18:00
Show Gist options
  • Save solar/2ebf8fd5caf7bd0cb996 to your computer and use it in GitHub Desktop.
Save solar/2ebf8fd5caf7bd0cb996 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name trade_helper
// @namespace sazabi.org
// @include http://*.3gokushi.jp/card/deck.php*
// @version 1
// @require http://zeptojs.com/zepto.min.js
// @require https://raw.githubusercontent.com/madrobby/zepto/master/src/selector.js
// @grant none
// ==/UserScript==
Zepto(function($) {
var trade_url = '/card/trade.php?s=price&o=a&t={type}&k={query}&tl=1&r_l=1&r_ur=1&r_sr=1&r_r=1&r_uc=1&r_c=1&r_pr=&r_hr=&r_lr=&lim=1&r_ur=1&r_sr=1&r_r=1&r_uc=1&r_c=1';
function open_trade(type, query) {
window.open(trade_url.replace('{type}', type)
.replace('{query}', query));
}
function no_to_trade_link() {
$('table.statusParameter1 > tbody').each(function() {
$('td:first', this).on('click', function() {
open_trade('no', $(this).text());
});
});
}
no_to_trade_link();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment