A good bit.ly javascript link for mobile Safari?

Discussion in 'iPhone' started by sallythemac, Aug 5, 2009.

  1. sallythemac Guest

    Joined:
    Jun 16, 2008
    #1
    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?
     
  2. sallythemac thread starter Guest

    Joined:
    Jun 16, 2008
    #2
    I have found a bookmarklet, however i haven't tried it on mobile Safari to check it works.

    For others though, it's here.
     
  3. SAG3194 macrumors 6502

    SAG3194

    Joined:
    Jan 4, 2009
    #3
    [​IMG]

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

    Attached Files:

  4. sallythemac thread starter Guest

    Joined:
    Jun 16, 2008
    #4
    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.
     
  5. sallythemac thread starter Guest

    Joined:
    Jun 16, 2008
    #5
    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)
     

Share This Page