Search tool

Search tool for Steamgifts.

Version au 25/11/2015. Voir la dernière version.

Vous devrez installer une extension telle que Tampermonkey, Greasemonkey ou Violentmonkey pour installer ce script.

You will need to install an extension such as Tampermonkey to install this script.

Vous devrez installer une extension telle que Tampermonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Userscripts pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension de gestionnaire de script utilisateur pour installer ce script.

(J'ai déjà un gestionnaire de scripts utilisateur, laissez-moi l'installer !)

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

(J'ai déjà un gestionnaire de style utilisateur, laissez-moi l'installer!)

// ==UserScript==
// @name         Search tool
// @description  Search tool for Steamgifts.
// @version      0.2
// @author       otro_user_gil
// @include      http://www.steamgifts.com/
// @include      https://steamgifts.com/
// @include      http://*.steamgifts.com/
// @include      https://*.steamgifts.com/
// @include      http://www.steamgifts.com/giveaway/*
// @include      https://steamgifts.com/giveaway/*
// @include      http://*.steamgifts.com/giveaway/*
// @include      https://*.steamgifts.com/giveaway/*
// @include      http://www.steamgifts.com/giveaways/*
// @include      https://steamgifts.com/giveaways/*
// @include      http://*.steamgifts.com/giveaways/*
// @include      https://*.steamgifts.com/giveaways/*
// @require      http://code.jquery.com/jquery-2.1.4.min.js
// @grant        none
// @namespace https://greasyfork.org/users/15121
// ==/UserScript==

$(".sidebar__mpu").append("<script type='text/javascript'>var url;var search_text;var min_entries;var max_entries;var min_level;var max_level;function ga(){search_text=document.getElementsByName('search-query')[0].value;if(search_text=='Search...'){search_text='';}min_entries=parseInt(document.getElementById('min_entries').value);max_entries=parseInt(document.getElementById('max_entries').value);min_level=document.getElementById('level_min').value;max_level=document.getElementById('level_max').value;if(min_entries>max_entries){alert('Min Entries Can not be higher than Max Entries.');}else if(min_level!='None'&&max_level!='None'&&min_level>max_level){alert('Min Level Can not be higher than Max Level');}else{if(search_text==''){if(isNaN(min_entries)==false||isNaN(max_entries)==false){if(isNaN(min_entries)==false&&isNaN(max_entries)==true){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries;location.href=url;}if(isNaN(min_entries)==true&&isNaN(max_entries)==false){url='http://www.steamgifts.com/giveaways/search?entry_max='+max_entries;location.href=url;}if(isNaN(min_entries)==false&&isNaN(max_entries)==false){url='http://www.steamgifts.com/giveaways/search?&entry_min='+min_entries+'&entry_max='+max_entries;location.href=url;}}else{if(min_level=='None'&&max_level=='None'){url='http://www.steamgifts.com/giveaways/search?';location.href=url;}if(max_level=='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?level_min='+min_level;location.href=url;}if(max_level!='None'&&min_level=='None'){url='http://www.steamgifts.com/giveaways/search?level_max='+max_level;location.href=url;}if(max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?level_min='+min_level+'&level_max='+max_level;location.href=url;}}if(isNaN(min_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&level_min='+min_level;location.href=url;}if(isNaN(min_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_max='+max_entries+'&level_min='+min_level;location.href=url;}if(isNaN(max_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+max_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&entry_max='+max_entries+'&level_min='+min_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&entry_max='+max_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&min_level!='None'&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&entry_max='+max_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}if(isNaN(min_entries)==false&&max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_min='+min_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?entry_max='+max_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}}else if(search_text!=''){if(isNaN(min_entries)==false||isNaN(max_entries)==false){if(isNaN(min_entries)==false&&isNaN(max_entries)==true){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries;location.href=url;}if(isNaN(min_entries)==true&&isNaN(max_entries)==false){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_max='+max_entries;location.href=url;}if(isNaN(min_entries)==false&&isNaN(max_entries)==false){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&entry_max='+max_entries;location.href=url;}}else{if(min_level=='None'&&max_level=='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text;location.href=url;}if(max_level=='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&level_min='+min_level;location.href=url;}if(max_level!='None'&&min_level=='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&level_max='+max_level;location.href=url;}if(max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}}if(isNaN(min_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&level_min='+min_level;location.href=url;}if(isNaN(min_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+max_entries+'&level_min='+min_level;location.href=url;}if(isNaN(max_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+max_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&entry_max='+max_entries+'&level_min='+min_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&entry_max='+max_entries+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&isNaN(min_entries)==false&&min_level!='None'&&max_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&entry_max='+max_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}if(isNaN(min_entries)==false&&max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_min='+min_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}if(isNaN(max_entries)==false&&max_level!='None'&&min_level!='None'){url='http://www.steamgifts.com/giveaways/search?q='+search_text+'&entry_max='+max_entries+'&level_min='+min_level+'&level_max='+max_level;location.href=url;}}}}</script><br><div style='position: relative;'><span>Level Min: </span> <select id='level_min' style='width: 90px;'><option>None</option><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select> <span> Level Max: </span><select id='level_max' style='width: 90px;'><option>None</option><option>0</option><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></select><br><br><span> Min Entries: </span><input type='number' style='width: 60px;' id='min_entries' min='0'> <span> Max Entries: </span> <input type='number' style='width: 60px;' min='0' id='max_entries'><br><br><input type='button' style='cursor: pointer; width: 60px;' value='Search ' onClick='ga()'></div>")