Skip to content

Instantly share code, notes, and snippets.

@leafnode
Created July 23, 2015 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leafnode/61fa9f45ad3f81a59fef to your computer and use it in GitHub Desktop.
Save leafnode/61fa9f45ad3f81a59fef to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Bidding Status
// @namespace leafnode
// @include http://allegro.pl/myaccount/bid.php
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// ==/UserScript==
jQuery('#items-list tbody tr').each( function ( i ) {
var el = ''+jQuery(this).find('td:nth-child(2)').find('.uname a').attr('href');
var winning = (el.indexOf('show_user.php') != -1);
if (winning) {
jQuery(this).append('<td style="background-color: green; border: 1px solid silver">WIN</td>');
console.log("Winning!");
} else {
jQuery(this).append('<td style="background-color: red; border: 1px solid silver">LOSE</td>');
console.log("Losing!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment