Permalink
Browse files

Reblog bookmarklet

  • Loading branch information...
ljcooke committed Mar 23, 2011
1 parent fd60736 commit 955df3e56d9c411108d52377ed206fd30a0664a1
Showing with 31 additions and 0 deletions.
  1. +30 −0 bookmarklets/reblog.js
  2. +1 −0 bookmarklets/reblog.z.js
View
@@ -0,0 +1,30 @@
+// 1. Minify with http://jscompress.com/
+// 2: s/ /%20/g
+// 3. s/^/javascript:/
+
+(function() {
+
+ var w = window,
+ d = document,
+ l = d.location,
+ t = d.title,
+ u = /\/([0-9]+)($|\/)/.exec(l.pathname),
+ c = 'inkyrblg',
+ p, r, s;
+
+ inkyrblg = function(o) {
+ p = o.posts[0];
+ w.location = 'http://www.tumblr.com/reblog/' + p.id + '/' + p['reblog-key'];
+ };
+
+ if (u && u[1]) {
+ d.title = '(Loading...)%20' + t;
+ w[c] = eval(c);
+ s = d.createElement('SCRIPT');
+ s.src = 'http://' + l.host + '/api/read/json?callback=' + c + '&id=' + u[1];
+ d.getElementsByTagName('HEAD')[0].appendChild(s);
+ } else {
+ alert('This will only work on a Tumblr post page.');
+ }
+
+}())
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 955df3e

Please sign in to comment.