Best Blackhat Forum

Full Version: [TUT] Sort Pinterest Pin Result from Largest to Smallest Repins Count
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi Guys,

I just want to share how to sort the pinterest result based on their repins count.

I think this will be useful if you need some viral ideas for your blog or facebook page.

You only need firefox browser. (not tested with Chrome)

Step by step
1. Open pinterest.com and login with your account.
2. Type keyword on search bar.

[Image: result1.png]

3. Press Ctrl+Shift+K

[Image: result2.png]

4. Copy the code below and paste it under prompt box. See the picture above.

Code:
var script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";

Code:
var script = document.createElement('script');script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js";document.getElementsByTagName('head')[0].appendChild(script);
var pages = 10;
var count = 0;
var mylist = [];
var timeout;
load();

function load(){

  $('.Pin').each(function(){
    mylist.push( $(this)[0] )
  });

  $(window).scrollTop( $(document).height() );

  timeout = window.setTimeout(load, 4000);

  count++;
  if(count==pages){
      finish();
  }
}

function finish(){
    window.clearTimeout(timeout)
    console.log(mylist.length);

    var list = mylist.filter(function(f){
      if( $(f).find('.repinCountSmall').length>0 ){
        return f;
      }
    });

    console.log(list);

    list.sort(function(a, b) {
       var compA = Number( $(a).find('.repinCountSmall').text().trim() );
       var compB = Number( $(b).find('.repinCountSmall').text().trim() );
       return (compA == compB) ? 0 : (compA > compB) ? -1 : 1;
    });

    $(".Grid").before('<div id="organized"/>').remove();

    $.each(list, function(idx, itm) {
      $("#organized").append($(itm));
    });

    $('.Pin').css({'clear': 'both', 'position': 'static'});
}

5. Press enter, and boom!! All pins will sort by their repins count.

[Image: result3.png]

Please add reputation if this useful for you! SmileSmileSmile
Nice share thanks a lot :)
update

if you want to open more than 5 pages, (5 scroll down) change the variable code

Code:
var pages = [change this number];
good sharing.thanks
nice thanks i try it later :)
Let me try. Rep added.
Neat trick. Thanks for the code xfactor! Repped!
Thanks bro, but I'm getting syntax error
(07-17-2015 04:32 PM)rgbiz Wrote: [ -> ]Thanks bro, but I'm getting syntax error

If you copy the code, don't forget to delete
"Read more @ bestblackhatforum.com : ...."

This signature message will automatically included into your clipboard when you press ctrl + c
I get this error:

TypeError: $(...).each is not a function
Pages: 1 2
Reference URL's