Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sallythemac

macrumors 6502
Original poster
Jun 16, 2008
274
8
I have searched MacRumors, even Google, but no joy...

I am looking for a javascript link that i can bookmark in mobile Safari so i can quickly make a bit.ly or similar compressed link to the page i am viewing. So i can copy and paste it and text it to someone or use it in other apps. Seems like there is something similar in Tweetie for creating a shortened link ready to be tweeted, but a javascript link that meant i didn't have to leave Safari would be ace.

Any suggestions?
 
I have found a bookmarklet, however i haven't tried it on mobile Safari to check it works.

For others though, it's here.
 
attachment.php


Doesn't work that well. Can't scroll to the right when on a mobile version of a site.
 

Attachments

  • photo-69.jpg
    photo-69.jpg
    53.8 KB · Views: 295
I used the one below, the "Standard bit.ly Bookmarklet".

Here's the actual link:

javascript:var%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:('%22'+enc(s)+'%22')),f='http://bit.ly/',l=d.location,p='?v=3&u='+enc(l.href)%20+'&s='+enc(d.title)+'%20'+s2,u=f+p;try{if(!/^(.*\.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a%20=function(){if(!w.open(u))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();}void(0)

Works well, just a shame bit.ly don't seem to have an iPhone-optimised page.
 
Here it is minus smilies!!

javascript:var%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:('%22'+enc(s)+'%22')),f='http://bit.ly/',l=d.location,p='?v=3&u='+enc(l.href)%20+'&s='+enc(d.title)+'%20'+s2,u=f+p;try{if(!/^(.*\.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a%20=function(){if(!w.open(u))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();}void(0)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.