functionarticles(){constresults=[]constarticles=document.querySelectorAll('.single-article')letdata;for(leti=0;i<articles.length;i++){data=article(articles[i])if(data){results.push(data)}}returnresults}functionarticle(article){// if there is no time selector that means this article // is not published and will have no useful statsif(article.querySelector('time')){constname=article.querySelector('h2').innerTextconsttags=article.querySelectorAll('.tag')constauthor=article.querySelector('option[selected=selected]').innerTextconstdate=article.querySelector('time').innerTextconstpage_view_count=article.querySelector('.page-views-count').innerTextconstreactions_count=article.querySelector('.reactions-count').innerTextconstcomments_count=article.querySelector('.comments-count').innerTextconsttags_string=[]for(lett=0;t<tags.length;t++){tags_string.push(tags[t].innerText)}return{name:name,tags:tags_string.join(''),author:author,date:date,page_views_count:page_view_count,reactions_count:reactions_count,comments_count:comments_count}}else{returnfalse}}functionsave_data(){constresults=JSON.stringify(articles())varblob=newBlob([results],{type:'text/json'})lete=document.createEvent('MouseEvents')leta=document.createElement('a')constdate=newDate().getTime()constepoch=Math.round(date/1000)a.download=`export-${epoch}.json`a.href=window.URL.createObjectURL(blob)a.dataset.downloadurl=['text/json',a.download,a.href].join(':')e.initMouseEvent('click',true,false,window,0,0,0,0,0,false,false,false,false,0,null)a.dispatchEvent(e)}save_data()
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you want this as json instead of csv