Guest User

Untitled

a guest
Dec 5th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        PPJ HFR
  3. // @namespace   forum.hardware.fr
  4. // @description Indique le nombre de posts par jour pour un profil
  5. // @include     http://forum.hardware.fr/hfr/profil-*
  6. // @version     1
  7. // @grant       none
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
  9. // ==/UserScript==
  10.  
  11.  
  12. var pseudo = '';
  13. var nbMsg = 0;
  14. var nbDays = 0;
  15.  
  16. $('.profilCase3').each(function(index){
  17.   if (0==index){
  18.     pseudo = $.trim($(this).text());
  19.   }else if(9==index){
  20.     nbMsg = parseInt($(this).text());
  21.   }else if(10==index){      
  22.     nbDays = Math.floor((new Date() - new Date($(this).text().split('/')[2], parseInt($(this).text().split('/')[1]) - 1 , $(this).text().split('/')[0]))/(1000*60*60*24));
  23.   }
  24. });
  25.  
  26. alert(pseudo + ' poste environ '+ Math.floor(nbMsg/nbDays)+ ' messages par jour !');
Advertisement
Add Comment
Please, Sign In to add comment