The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
RubyURL Bookmarklet - Now with Google Maps Support

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Andy Delcambre

Posts: 66
Nickname: adelcambre
Registered: Sep, 2007

Andy Delcambre is a developer at PLANET ARGON
RubyURL Bookmarklet - Now with Google Maps Support Posted: Nov 7, 2007 4:59 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Andy Delcambre.
Original Post: RubyURL Bookmarklet - Now with Google Maps Support
Feed Title: Andy Delcambre
Feed URL: http://feeds.feedburner.com/andydelcambre
Feed Description: Andy has been using Ruby and Ruby on Rails since 2006 and has been working with Ruby on Rails professionally since June 2007.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Andy Delcambre
Latest Posts From Andy Delcambre

Advertisement

I use RubyURL fairly extensively for linking to long urls. It was written internally here at PLANET ARGON by Chris Griffin and Robby Russell.

The RubyURL bookmarklet is a god send, want to link somewhere that has a long url? Just click the RubyURL this link button and copy the address, the problem that I had is that it didn’t work with google maps, which have extremely long urls and requires many steps to generate a RubyURL. First you click, “link to this page”, copy the text from the little popup, go to rubyurl.com, paste the text and get your RubyURL.

I figured that there must be a way to grab that link from the document itself on the Google Maps site. I whipped out my Javascript book and got it working in short order.

The code looks like


javascript:void(location.host=='maps.google.com'?location.href='http://rubyurl.com/rubyurl/remote?website_url='+encodeURIComponent(document.getElementById('link').href):location.href='http://rubyurl.com/rubyurl/remote?website_url='+encodeURIComponent(location.href))

Which is ugly as it’s a bookmarklet. Drag this to your bookmark bar if you want to start using it: RubyURL this Link

You don’t even need to click the “Link to this page” link on google maps before using it, it grabs it right out of the document. I will try to get this added to the RubyURL site as the official bookmarklet as well.

Are there other sites that don’t work well with the bookmarklet? Let me know in the comments!

Read: RubyURL Bookmarklet - Now with Google Maps Support

Topic: Parsing html with Haskell Previous Topic   Next Topic Topic: Learning something and win an iPod Nano

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use