To make this a bookmark, go to Twitch, press
Ctrl + D
, and for the URL use the code below →
javascript:(()=>{let t=(t,e=document)=>{let i=[...e.querySelectorAll(t)];return i.length>1?{...i,first:i[0],last:i[i.length-1]}:{...i[0],first:i[0],last:i[0]}},e=1e3,i=60*e,n=!0,r=0,s=0,a=0,l=!1,o={get update(){return p.update=setInterval(w,3e3)},get writer(){return p.writer=setInterval(()=>m.innerText,30*e)}},c=t("#auto-community-points").first,u=t('#auto-community-points svg[class*="channelpoints"i], img[class*="channelpoints"i]').first,m=t('#auto-community-points [class$="animated-number"i]').first,p={update:null,writer:null},d={Watching:0,Actively_Watching:0,Earned:{Watching:5,Actively_Watching:15},Oldest:()=>Math.min.apply(null,Object.values(d).filter(t=>+t))},f=t=>null!=t,y=(...t)=>{for(let e of t)clearInterval(p[e])},h=(...t)=>{for(let e of t)o[e]},w=()=>{if(n&&(a=t('#auto-community-points [data-test-selector="community-points-summary"i] button + [role="tooltip"]').first.innerText=t('[data-test-selector="community-points-summary"i] button + [role="tooltip"]').last.innerText,a=parseInt(a.replace(/^\s*([\d,]+).*/,"$1").replace(/\D+/g,""))||0,s!=a))if(l){for(let t in d)"number"==typeof d[t]&&d[t]<=+new Date+e&&(d[t]=+new Date+d.Earned[t]*i);y("update","writer"),h("update","writer")}else r=s=a,l=!0;f(w.COLLECTING_BONUS_POINTS)||(w.COLLECTING_BONUS_POINTS=(()=>{setInterval(()=>{let e=t('[data-test-selector="community-points-summary"i] button.tw-button.tw-button--success.tw-interactive').first;e&&n&&e.click()},3e3);return c.onclick=(t=>{(n=!n)?h("update","writer"):y("update","writer"),m.innerText=["OFF","ON"][+n],u.setAttribute("style",`fill: var(--color-${["red","accent"][+n]})!important;`)}),!0})())};if(!f(c)){let e=t('[data-test-selector="community-points-summary"i]').first,i=t(".top-nav__menu > div").last,n=(t('button + [role="tooltip"i]',e).first,document.createElement("div"));if(!f(e))throw"This streamer has not enabled community channel points.";n.id="auto-community-points",n.classList.add("community-points-summary","tw-align-items-center","tw-flex","tw-full-height"),n.innerHTML=e.outerHTML,i.insertBefore(n,i.children[1]),t('#auto-community-points [data-test-selector="community-points-summary"i] > div:last-child:not(:first-child)').first.remove(),c=n,u=t('svg[class*="channel"i][class*="points"i], img[class*="channel"i][class*="points"i]',n).first,(m=t('[class$="animated-number"i]',n).first).innerText="ON",h("update","writer")}})();