Last active
December 16, 2015 09:46
-
-
Save icedman21/6117c5f46a7f58490dfb to your computer and use it in GitHub Desktop.
ReVerT - Request Verification Tool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name ReVerT | |
// @namespace http://icedman21.com | |
// @description Request Verification Tool | |
// @version 0.2 | |
// @author Iced_Man21 | |
// @match https://www.thumbtack.com/admin/requests/syndication/portal* | |
// @updateURL https://gist.github.com/icedman21/6117c5f46a7f58490dfb/raw/revert.user.js | |
// @downloadURL https://gist.github.com/icedman21/6117c5f46a7f58490dfb/raw/revert.user.js | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM_getResourceText | |
// @grant GM_getResourceURL | |
// @grant GM_addStyle | |
// @require http://code.jquery.com/jquery-2.1.4.min.js | |
// @require http://code.jquery.com/ui/1.11.4/jquery-ui.js | |
// ==/UserScript== | |
/* jshint -W097 */ | |
'use strict'; | |
// setup noconflict | |
var $i = jQuery.noConflict(true); | |
//list of spmmy IP addresses | |
ipAddresses = ["198.181.18.21", "172.90.49.105", "45.46.227.79", "204.45.80.246", "204.45.182.2", "197.228.30.56", "41.146.2.127", "207.244.89.110", "207.244.77.2", "112.202.27.201", "209.172.52.137", "78.129.243.188", | |
"38.132.105.102", "162.216.46.159", "162.216.46.127", "209.95.50.148", "198.11.246.178", "64.150.190.10", "38.132.105.101", "199.115.115.209", "208.31.49.57", "199.115.115.209", "208.31.49.57", "199.115.115.209", | |
"199.115.114.220", "108.59.8.210", "50.117.41.121", "154.120.84.28", "38.132.105.99", "209.197.20.244", "199.115.114.229", "108.59.8.218", "207.244.77.2", "207.244.77.1", "199.115.114.229", "108.59.8.208", "69.88.157.89", | |
"74.207.236.184", "207.244.77.3", "209.58.128.135", "209.58.128.134", "207.244.77.2", "207.244.77.142", "199.115.116.35", "207.244.77.1", "108.59.8.217", "209.58.128.135", "207.244.83.97", "103.10.199.149", "199.115.114.229", | |
"207.244.83.211", "207.244.83.212", "207.244.83.119", "207.244.86.210", "207.244.72.201", "46.165.203.34", "46.165.220.221", "178.162.208.141", "178.162.207.3", "178.162.216.39", "37.58.52.55", "178.162.208.141", "46.165.246.176", | |
"41.138.162.238", "37.58.52.109", "178.162.208.142", "178.162.216.32", "178.162.216.30", "178.162.216.36", "41.138.162.237", "54.86.219.241", "104.131.94.130", "216.23.197.66", "76.25.228.107", "199.117.69.26", "98.124.175.96", | |
"107.161.178.250", "96.227.239.138", "166.171.59.80", "108.16.8.230", "166.171.57.153", "216.38.136.194", "198.11.221.137", "24.158.9.166", "197.210.224.96", "199.115.115.208", "216.23.197.66", "71.229.176.214", "76.25.228.107", | |
"199.117.69.26", "107.30.236.64", "66.117.9.238", "216.23.197.66", "71.229.176.214", "76.25.228.107", "199.117.69.26", "107.30.236.64", "23.108.40.83", "107.167.70.114", "54.86.219.241", "207.244.72.223", "207.244.72.224", | |
"199.115.116.35", "208.109.106.131", "23.97.66.175", "50.62.209.71", "108.59.8.210", "23.227.160.6", "23.227.160.4", "199.115.114.229", "197.211.52.9", "108.59.8.210", "198.206.15.161", "98.235.49.127", "24.115.132.200", | |
"173.19.23.187", "54.86.219.241", "98.213.170.192", "209.95.36.61", "206.190.136.246", "66.117.9.238", "216.68.91.2", "197.255.169.149", "24.176.47.247", "154.120.107.198", "98.117.81.128", "108.59.10.153", "166.62.96.72", | |
"199.115.116.80", "166.62.97.24", "167.114.119.198", "54.85.190.36", "209.197.16.138", "138.128.161.166", "54.208.149.147", "209.58.128.138", "23.27.45.177", "208.43.123.152", "54.85.190.36", "216.68.91.2", "165.225.166.77", | |
"159.203.80.26", "108.59.82.188", "162.208.49.45", "159.203.1.226", "66.64.11.45", "50.56.218.127", "50.23.67.21", "66.110.216.74", "64.150.190.59", "68.168.98.36", "207.244.77.4", "166.62.97.24", "207.244.77.3", "108.59.8.218", | |
"199.115.114.229", "207.244.72.222", "209.58.128.137", "108.59.8.218", "199.115.114.229", "54.86.219.241", "98.124.175.235", "54.85.190.36", "209.95.36.14", "108.59.8.217", "207.244.77.2", "54.149.111.226", "54.85.190.36", | |
"209.73.137.147", "98.124.175.235", "209.73.137.147", "207.244.77.4", "50.46.109.175", "50.118.162.176", "69.22.174.90", "199.115.114.229", "199.115.115.214", "136.0.99.125", "198.23.106.24", "24.234.78.6", "69.22.179.223", | |
"65.51.25.202", "207.244.83.219", "207.244.77.1", "207.244.83.196", "207.244.79.141", "199.115.116.80", "207.244.77.17", "199.115.116.35", "108.59.8.208", "207.244.82.113", "192.96.205.134", "216.185.58.90", "50.118.198.103", | |
"136.0.99.149", "95.211.171.169", "95.211.171.171", "107.183.243.180", "198.15.102.12", "207.244.83.117", "172.56.12.149", "162.220.220.135", "73.180.170.62", "96.33.64.7", "104.131.215.129", "207.244.72.225", "69.112.0.44", | |
"69.143.93.173", "207.244.78.14", "66.87.98.245", "74.93.27.65", "72.211.193.223", "198.8.80.2", "213.184.127.45", "162.216.46.98", "207.244.66.242", "107.191.111.165", "198.154.247.87", "174.240.164.78", "70.113.99.48", | |
"23.114.61.149", "162.203.173.239", "209.107.214.62"]; | |
//setup CSS for divs | |
$i("#contents").append("<div id='logins' ><span> </span><br><a id='toggleLogins' href='javascript:void(0);' accessKey='L'>Toggle Logins</a><table><tr id='email'></tr><tr id='reviews'></tr><tr id='hired'></tr><tr id='picked'></tr></table><div id='data-table'></div></div>"); | |
$i("#logins").css("position","absolute"); | |
$i("#logins").css("top","100px"); | |
$i("#logins").css("right","100px"); | |
$i("#logins").css("margin","10px"); | |
$i("#logins").css("min-width","180px"); | |
$i("#logins").css("width","auto"); | |
$i("#logins").css("background-color","#ffbe5"); | |
$i("#logins").css("padding","10px"); | |
$i("#logins").css("border","3px solid black"); | |
$i("#logins").css("border-radius","10px"); | |
$i("#logins").css("text-align","center"); | |
//hide floating box until populated with data | |
$i("#logins").hide(); | |
//make floating div draggable | |
$i("#logins").draggable(); | |
var url = $i("#contents h1 a:nth-child(2)").attr('href'); | |
var userId = url.split("=")[1]; | |
//console.log("url is " + url + " userid is = " + userId); | |
$i("#toggleLogins").click(function(){ | |
$i("#data-table").toggle(); | |
}); | |
$i("#data-table").load("https://www.thumbtack.com//admin/users/user/" + userId + "/tables/credential-logs",undefined, function(responseTxt, statusTxt, xhr){ | |
$i("#logins").show(); | |
$i("#data-table").hide(); | |
spammyCount = 0; | |
//$i("#email").load(url+" #summary .basic-details:first tr:first-child td"); | |
$i.ajax({ | |
url: url, | |
dataType: 'html', | |
success: function(html) { | |
var emailAdd = $i('#summary .basic-details:first tr:first-child td', $i(html)).html(); | |
$i('#email').html("<td style='text-align:left;'>Email Address:</td><td>"+ emailAdd+ "</td>"); | |
hired = 0; picked = 0; reviews=0; | |
//reviews written | |
$i("[data-table=reviews-written] tr td:first-child", $i(html)).each(function(){ | |
//console.log("Reviews is: " + $i(this).html().trim().toUpperCase() ); | |
reviews++; | |
}); | |
$i('#reviews').html("<td style='text-align:left;'># of SP Reviews Submitted:</td><td>"+ reviews+ "</td>"); | |
//picked count | |
$i("[data-table=requests] tr td[data-field=status]", $i(html)).each(function(){ | |
//console.log("PickedStatus is: " + $i(this).html().trim().toUppercase() ); | |
if($i(this).html().trim().toUpperCase() == "PICKED") { | |
picked++; | |
} | |
}); | |
$i('#picked').html("<td style='text-align:left;'># of Requests W/ Picked Status:</td><td>"+ picked+ "</td>"); | |
//hired count | |
$i("[data-table=requests] tr td[data-field=status]", $i(html)).each(function(){ | |
//console.log("Status is: " + $i(this).html().trim().toUppercase() ); | |
if($i(this).html().trim().toUpperCase() == "HIRED") { | |
hired++; | |
} | |
}); | |
$i('#hired').html("<td style='text-align:left;'># of Requests W/ Hired Status:</td><td>"+ hired+ "</td>"); | |
} | |
}); | |
//Spammy IP Login Count Header | |
$i(".admin_table tr").each(function(){ | |
//$i(this).children(":first").hide(); | |
var found = false; | |
var ipAdd = $i(this).children(":last").html().trim(); | |
found = $i.inArray(ipAdd, ipAddresses) > -1; | |
$i(this).children(":last").html("<a target='_blank' href='http://ip-api.com/#" + ipAdd + "'>"+ ipAdd + "</a>"); | |
if(found) { | |
//console.log($i(this).children(":last").html().trim() + " is spammy"); | |
$i(this).children(":last").css("color","red"); | |
$i(this).children(":last").css("font-weight","bold"); | |
$i(this).children(":last").children("a").css("color","red"); | |
spammyCount++; | |
} else { | |
//console.log($i(this).children(":last").html().trim() + " is not spammy" + $i.inArray($i(this).children(":last").html().trim(), ipAddresses)); | |
} | |
$i("#logins span").css("font-size","18px"); | |
$i("#logins span").html("<span>Spam IP Login Count: <b>"+ spammyCount+"</b></span>"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment