Advertisement
MattePRL

Generator listy do zawołania

Nov 2nd, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var me = $('.avatar').not('[alt=""]').first().attr('alt');
  2.  
  3. function uniq(a) {
  4.     return a.sort().filter(function(item, pos) {
  5.         return !pos || item !== a[pos - 1];
  6.     })
  7. }
  8.  
  9. var peopleToCall = [];
  10. $(".voters-list").first().find('a').each(function(i, element) {
  11.     var nick = $(element).html();
  12.     if (nick === me) return true;
  13.     peopleToCall.push("@" + nick);
  14.  
  15. })
  16.  
  17. $(".sub .author a.showProfileSummary b").each(function(i, element) {
  18.     var nick = $(element).html();
  19.     if (nick === me) return true;
  20.     peopleToCall.push("@" + nick);
  21. });
  22.  
  23. peopleToCall = uniq(peopleToCall);
  24. console.log("Wołam: " + peopleToCall.join(" "));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement