Skip to content

Instantly share code, notes, and snippets.

@sergiks
Created February 8, 2017 08:53
Show Gist options
  • Save sergiks/23a22e9553c84078ca5d95bddaa0f9e4 to your computer and use it in GitHub Desktop.
Save sergiks/23a22e9553c84078ca5d95bddaa0f9e4 to your computer and use it in GitHub Desktop.
Букмарклет для подсчёта выплат за месяц на AppsCentrum (минифицирован)
(function(t){var e,n,a,h=$("table"),r={},o=new Date,l="";if(!("my.appscentrum.com"!=window.location.hostname||h.length<4)){for(o.setDate(1),a=0;t>a;a++)e=("0"+(parseInt(o.getMonth())+1)).substr(-2),n=""+o.getFullYear(),r[""+e+"."+n]=0,o.setMonth(o.getMonth()-1);h=h[3],$("tr",h).each(function(t,e){var n,a,h=$("td:nth-child(5)",this).text().split(/[\ \.]/);h.length>=2&&(a=""+h[1]+"."+h[2],r.hasOwnProperty(a)&&(n=$("td:nth-child(3)",this).text(),(n=n.replace(/[^0-9\.]+/g,"")).length&&(r[a]+=parseFloat(n))))});for(key in r)l+=""+Math.round(100*r[key])/100+" руб. за "+key+"\r\n";alert(l)}})(5);
@sergiks
Copy link
Author

sergiks commented Feb 8, 2017

Несжатая версия тут.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment