Skip to content

Instantly share code, notes, and snippets.

@rastasheep
Created December 11, 2012 00:32
Show Gist options
  • Save rastasheep/4254665 to your computer and use it in GitHub Desktop.
Save rastasheep/4254665 to your computer and use it in GitHub Desktop.
Tubalr bookmarklet

Usage

  • Add content of compressed.js code as bookmarklet to your bookmark bar
  • Go to any youtube video
  • Click the bookmarklet
  • Now you'll be redirected to tubalr

Alt. usage

  • Add any random page to your bookmark bar
  • Edit the bookmark bar entry
  • Change name and the URL from http://randompage.net to content of compressed.js code
  • Go to any youtube video
  • Click the bookmark
  • Now you'll be redirected to tubalr

__

Here is and expended code too, for anyone who want to know how it forks

javascript:((function(){var a=window.location.search.split('v=')[1];var b=a.indexOf('&');if(b!=-1){a=a.substring(0,b)}window.location=" http://www.tubalr.com/video/"+a})())
javascript: ((function () {
//detect video id
var video_id = window.location.search.split('v=')[1];
var ampersandPosition = video_id.indexOf('&');
if(ampersandPosition != -1) {
video_id = video_id.substring(0, ampersandPosition);
}
//redirect to tubalr
window.location = " http://www.tubalr.com/video/"+video_id;
})())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment