Hack Forums
[Userscript] [MarketPlace] Deal Disputes + Rep Count + Trust Scan in Postbit - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Computing (https://hackforums.net/forumdisplay.php?fid=88)
+---- Forum: Computing Lounge (https://hackforums.net/forumdisplay.php?fid=8)
+---- Thread: [Userscript] [MarketPlace] Deal Disputes + Rep Count + Trust Scan in Postbit (/showthread.php?tid=4201623)

Pages: Pages 1 2 3 4


* - King of Hearts - May 15, 2014

I've been pmed that Userscripts has had a lot of downtime recently.

Here's the script:
PHP Code

<?php 
// ==UserScript==
// @name      Deal Dispute on Postbit
// @namespace  http://codeinstitution.net/DealDisputePostbit
// @version    1.0
// @description  Deal Disputes will be shown on postbit
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @include     *hackforums.net/*
// @copyright  2014+, Saad T (King of Hearts)
// ==/UserScript==

URL = window.location.href;
if(
URL.indexOf("hackforums.net/showthread.php") > -1){    
    var 
x = document.querySelectorAll('.navigation > a');
    if(
x[1].innerHTML == "Marketplace"){
      
injectjs();
      
posts = $("#posts").find("td[class='post_author']");
      
authorInfo = $("#posts").find("td[class='smalltext post_author_info']");
      var 
l = posts.length;
      for(var 
i = 0; i < l; i++){
      
username = $(posts[i]).find(".largetext");
      var 
res = username[0].innerHTML.match(/<a href="(.*)"><span class="(.*)">(.*)<\/span>/);
      
usernameN = res[3];
      
authorInfo[i].innerHTML += '<br /><div id="dealdispute'+i+'"><a href="javascript:void(0)" onclick="document.getElementById(\'dealdispute'+i+'\').innerHTML = getScams(\''+usernameN+'\');">Check for Deal Disputes</a>';//getScams(usernameN);
      
}
    }
}else if(
URL.indexOf("hackforums.net/disputedb.php?user=") > -1){
  var 
user = URL.split("?user=")[1];
  
document.body.outerHTML = /<body.*?>([\s\S]*)<\/body>/.exec(getScams(user))[1];

}

function getScams(user){
    var data = null;
    $.ajax({
      type: "POST",
      async: false,
      url: "disputedb.php",
      data: {
      username:user,
            action: "do_search",
            submit: "search",
            my_post_key:document.documentElement.innerHTML.split('my_post_key = "')[1].split('";')[0]
      }}
      ).done(function( dataR ) {
      data = dataR;
      });
  return data;
}
function injectjs() {
    $('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" />"<script type="text/javascript">'+ 'function getScams(user){var data = null;    $.ajax({      type: "POST",      async: false,      url: "disputedb.php",      data: {      username:user,            action: "do_search",            submit: "search",            my_post_key:document.documentElement.innerHTML.split("my_post_key = \\"")[1].split("\\";")[0]      }}).done(function(dataR) {      data = dataR;      }); if(data.indexOf("No Results") > -1){return "Deal Disputes: <span style=\\"color:green\\">None</span>";}else{tds = $(data).find(\'table:eq(1)\').find(\'td\');var count = 0;      for(var i = 5; i < tds.length; i+=5){      if($(tds).eq(i + 5).text() == "Open" &&$(tds).eq(i + 3).text() == user){            count++;      }      }if(count == 0){return "Deal Disputes: <span style=\\"color:green\\">None</span>";}else {return "Deal Disputes: <span style=\\"color:red\\"><a href=\\"/disputedb.php?user="+user+"\\">"+count + "</a></span>";}}}' +'</script>').appendTo($('head')); 
} 



* - -zYMTOM' - May 20, 2014

Great tool by this fellow member. Thanks for the share.


* - Vitamin Energy - May 20, 2014

That is actually pretty great :)

Keep up the good work buddy :)


* - A Powerade - May 21, 2014

Nice userscript! This might come in handy when I do Marketplace things.


* - King of Hearts - Jul 31, 2015

(May 22, 2014 12:54 PM)xadamxk Wrote:  Any progress on this implementation?

So a year and a bit over I found this userscript on my old laptop. Anyways, I've decided to update it a bit.

I've made the following changes:

Quote:This script now also checks a users reputation and tells you how many negative and neutral feedbacks the user has (amount not value). It also searches the first page of the feedback and looks for words such as 'scam, shady, lier, caution' and lets you know if those are mentioned. Last but not least, a trust scan link is placed for ease of access.


I've also reuploaded it here: https://greasyfork.org/en/scripts/11359-deal-dispute-on-postbit

Please let me know of any bugs and such.

Thanks,
KoH


* - King of Hearts - Aug 2, 2015

(Aug 2, 2015 05:20 PM)xadamxk Wrote:  How have I never seen this script before? xD
It's pretty cool.

You have, look at the second post above yours :P

I just grave dug and updated it.🤝


* - Hash G. - Aug 3, 2015

This userscript is literally gold. Great job!

Edit: But the link in the OP is broken.


* - King of Hearts - Aug 3, 2015

(Aug 3, 2015 03:23 PM)Hash G. Wrote:  This userscript is literally gold. Great job!

Edit: But the link in the OP is broken.

Link seems to be fine for me...Here you go: https://greasyfork.org/en/scripts/11359-deal-dispute-on-postbit

Thanks,
KoH


* - Eternal. - Aug 31, 2015

This looks awesome, will be using it from now on. Thank you!


* - King of Hearts - Sep 7, 2015

(Aug 31, 2015 10:47 AM)Eternal. Wrote:  This looks awesome, will be using it from now on. Thank you!

I'm glad you've found this useful.

If there's anything I should add, let me know.


* - King of Hearts - Oct 20, 2015

I'd like to bring this back up.

Please use this userscript, it helps. Also, the new servers should make the requests even faster.


* - Raymond Reddington - Oct 20, 2015

From the new scammer reps rule implementation, this wouldn't be difficult? I mean no one can leave a "SCAMMER" feedback just that way.


* - Ahri - Oct 21, 2015

Shit this is just going to make people afraid to deal with me.


* - Mcbride - Oct 21, 2015

Posting to find this later


* - Inj3ct0r - Oct 21, 2015

Good job OP. Will definitely try it. Hope it makes the marketplace cleaner.