![]() |
|
Tutorial Count thread views - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: Tutorial Count thread views (/Thread-Tutorial-Count-thread-views) |
Count thread views - phyrrus9 - 07-28-2019 If you've ever wondered how you can add up the number of views your threads have received, fear no more! You don't need to go add up every thread manually. Let JS do the work for you. Instructions: Go to your profile and click "view threads". Then open developer console and paste this into it: Code: var rows = document.getElementsByClassName("inline_row");
var sum=0
let reg = new RegExp(",");
for (var i = 0; i < rows.length; i=i+1)
{
cols = rows[i].getElementsByClassName("trow1");
col = cols[5];
if (col !== undefined)
sum=sum+parseInt(col.innerText.replace(reg, ''));
}
console.log(sum);RE: Count thread views - papiswazy - 07-29-2019 Im dead someone had some time on their hands, haha respect RE: Count thread views - phyrrus9 - 07-29-2019 (07-29-2019, 12:07 AM)papiswazy Wrote: Im dead someone had some time on their hands, haha respect all of 2 minutes. the point of this forum is to share things that may be of use to others. I wanted to know what my view counts were on aggregate (approx 200k), and figured others might want the same. RE: Count thread views - Oni - 07-29-2019 Nice, that's one way to do it. Maybe we'll add a feature. RE: Count thread views - phyrrus9 - 07-29-2019 (07-29-2019, 01:54 AM)Oni Wrote: Nice, that's one way to do it. Maybe we'll add a feature. that would be nice... RE: Count thread views - papiswazy - 07-29-2019 (07-29-2019, 12:18 AM)phyrrus9 Wrote:(07-29-2019, 12:07 AM)papiswazy Wrote: Im dead someone had some time on their hands, haha respect im not trying to say anything rude homie, just saying its preety cool, nobody would think to do that but you did and i respect that. But damn 2 minutes.. hahah someone can finesse |