Skip to content

Instantly share code, notes, and snippets.

@kohashi
Created March 7, 2012 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kohashi/1992326 to your computer and use it in GitHub Desktop.
Save kohashi/1992326 to your computer and use it in GitHub Desktop.
bookmarklet for favstar.fm entry to CSV.
javascript:(function(){var r='';var FN=function(f,n){var t=f(n);return t.length?t[0].getElementsByClassName('count')[0].innerHTML:0};var DD=function(f){var d=new Date(f('js_time_repl')[0].attributes['data-time'].value);return d.getFullYear()+'/'+(d.getMonth()+1)+'/'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();};var a=document.getElementsByClassName('tweetWithStats');for(var i=0;i%3ca.length;i++){var f=function(n){return a[i].getElementsByClassName(n)}; r+=FN(f,'favCount')+','+FN(f,'rtCount')+',"'+DD(f)+'","'+(f('theTweet')[0].innerText||f('theTweet')[0].textContent)+'"\r\n';};e=document.createElement('textarea');e.innerHTML=r;e.style.width='100%';e.style.height='300px';document.getElementById('streamTitle').appendChild(e);})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment