Skip to content

Instantly share code, notes, and snippets.

@jsveron23
Last active July 11, 2016 07:51
Show Gist options
  • Save jsveron23/8909576 to your computer and use it in GitHub Desktop.
Save jsveron23/8909576 to your computer and use it in GitHub Desktop.
Bookmarklet to add tweet with start time when you watching Youtube
javascript:(function(){var u=location.href;p=document.getElementById('movie_player');var ct=p.getCurrentTime();var m=Math.floor(ct/60);var s=ct-m*60;s=s<9?0+''+s:s;s=Math.floor(s);var rt=m+'m'+s+'s';var nu=u+'&t='+rt;window.open('http://twitter.com/share?text'+encodeURIComponent('Watch this! - '+document.getElementsByTagName('title')[0].innerHTML)+'&url='+encodeURIComponent(nu)+'&hashtags=thisisit')})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment