Skip to content

Instantly share code, notes, and snippets.

@atme
Created April 22, 2015 09:10
Show Gist options
  • Select an option

  • Save atme/3c26cefdb41912675ba3 to your computer and use it in GitHub Desktop.

Select an option

Save atme/3c26cefdb41912675ba3 to your computer and use it in GitHub Desktop.
Autobump for csgolounge.com
// ==UserScript==
// @name csgolounge-autobump
// @namespace csgoloungeAutobump
// @include http://csgolounge.com/mytrades
// @version 1
// @grant none
// ==/UserScript==
/*global $, console*/
(function ($) {
'use strict';
var i, trades = [];
$('.tradepoll').each(function (i, element) {
trades.push($(element).attr('id').substr(5));
});
function updateTrades() {
for (i = 0; i < trades.length; i += 1) {
bumpTrade(trades[i]);
}
setTimeout(updateTrades, 1000 * 60 * 10 * (Math.random() * 2));
console.log('Trades is updated.');
}
setTimeout(updateTrades, 1000 * 60 * 10 * (Math.random() * 2));
}($));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment