[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RubyURL.com

Robby Russell

3/14/2005 10:45:00 AM

I felt like giving myself a small project to get my feet a bit more wet
with a small project in Rails

http://www.robbyon...artic...

resulted in having this up a few hours later:

http://ru...

I promise..if you add links, I won't delete them..it'll be up for as
long as I can maintain the $8/year for the domain.

*be gentle..* :-)

-Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby@planetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyon...
****************************************/



26 Answers

Sam Roberts

3/14/2005 2:15:00 PM

0

Quoting robby@planetargon.com, on Mon, Mar 14, 2005 at 07:45:19PM +0900:
> I felt like giving myself a small project to get my feet a bit more wet
> with a small project in Rails
>
> http://www.robbyonrails.com/artic...
>
> resulted in having this up a few hours later:
>
> http://ru...

I tried:
http://ru...

and got

<html><body><h1>Application error (Rails)</h1></body></html>

Cheers,
Sam



James Gray

3/14/2005 2:21:00 PM

0

On Mar 14, 2005, at 8:14 AM, Sam Roberts wrote:

> I tried:
> http://ru...
>
> and got
>
> <html><body><h1>Application error (Rails)</h1></body></html>

Hmm. It's working for me...

(Loading the first page anyway.)

James Edward Gray II



martinus

3/14/2005 2:32:00 PM

0

>> I tried:
>> http://ru...
>> and got
>> <html><body><h1>Application error (Rails)</h1></body></html>
>
> Hmm. It's working for me...

It seems to work for all urls, except when trying to create a link to
the rubyurl itself. Reading Robby's blog it looks like the URL filter
has a problem.

martinus

Alex Martin Ugalde

3/14/2005 3:16:00 PM

0

Hi James,

> > I tried:
> > http://ru...
> >
> > and got
> >
> > <html><body><h1>Application error (Rails)</h1></body></html>
>
> Hmm. It's working for me...
>
> (Loading the first page anyway.)
>
> James Edward Gray II

Try to put "http://ru..." in the form field and you will get this
error :)

Regards,
Alex
--
People in cars cause accidents. Accidents in cars cause people.



Nikolai Weibull

3/14/2005 3:32:00 PM

0

* Alex Martin Ugalde (Mar 14, 2005 16:20):
â?®
> > > <html><body><h1>Application error (Rails)</h1></body></html>
â?®
> > Hmm. It's working for me...
â?®
> Try to put "http://rubyurl.... in the form field and you will get
> this error :)

See http://rubyurl... on why this is so,
nikolai

P.S.
It's of course not a very good error message for this condition.
D.S.

--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


James Britt

3/14/2005 3:35:00 PM

0

Robby Russell wrote:
> I felt like giving myself a small project to get my feet a bit more wet
> with a small project in Rails
>
> http://www.robbyonrails.com/artic...
>
> resulted in having this up a few hours later:
>
> http://ru...

Nice. I noticed, though, that you do not get the same rubyURL for the
same source URL each time you do a conversion. I'm guessing then
there is no straightforward has mapping going on.

Would this sort of 1-to-1 mapping be useful? Two arguments come to mind:

1. Multiple use of the same source URL would not consume additional
space on each conversion; once a URL is entered, the same RubyURL is reused.

2. If a predictable hashing system is used that assures each source URL
maps to only one Ruby URL, and that algorithm is published, then people
can manually decode Ruby URLs if need be (should, say, the site go
away). For example, if you see this:
http://ru...2OJCU

you should be able to reverse-engineer it to this
http://www.rub...


Anyways, thanks for the site.

James



Robby Russell

3/14/2005 4:03:00 PM

0

On Tue, 2005-03-15 at 00:35 +0900, James Britt wrote:
> Robby Russell wrote:
> > I felt like giving myself a small project to get my feet a bit more wet
> > with a small project in Rails
> >
> > http://www.robbyon...artic...
> >
> > resulted in having this up a few hours later:
> >
> > http://ru...
>
> Nice. I noticed, though, that you do not get the same rubyURL for the
> same source URL each time you do a conversion. I'm guessing then
> there is no straightforward has mapping going on.
>
> Would this sort of 1-to-1 mapping be useful? Two arguments come to mind:
>

Yeah, that's on the list for things to do. It'll just return the
existing short_url rather than generating a new one.

*working on getting FCGI installed so it'll be a bit faster*

Cheers,

Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby@planetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyon...
****************************************/



Kirk Haines

3/14/2005 6:24:00 PM

0

James Britt wrote:

> Nice. I noticed, though, that you do not get the same rubyURL for the
> same source URL each time you do a conversion. I'm guessing then
> there is no straightforward has mapping going on.

In my little IOWA based system, I just do a query back to the database when
one enters a URL. If there is already a short version available, one is
informed of what the already existing URL is. The expense of a query here,
when entering a URL into the system, is minimal.

> away). For example, if you see this:
> http://rubyurl...
>
> you should be able to reverse-engineer it to this
> http://www.rub...

2OJCU does not have all of the information in it that www.ruby-doc.org does.
Hashing algorithms like that are one way encodings.

General philosophical question about these sorts of services. What is the
advantage of using a hashing algorithm over some sort of simple counter?

My implementation just uses a count, expressed as a base62 number. So, even
with a very, very large number of URLs in the database, the URLs will still
stay quite short, and if one has the disk space, one need never purge or
overwrite a URL as can happen when there are hashing algorithm collisions.

I suppose the downside is just that this makes it easy for someone to scan
the database of URLs?


Kirk Haines

Martin DeMello

3/14/2005 6:28:00 PM

0

James Britt <jamesUNDERBARb@neurogami.com> wrote:
>
> 2. If a predictable hashing system is used that assures each source URL
> maps to only one Ruby URL, and that algorithm is published, then people
> can manually decode Ruby URLs if need be (should, say, the site go
> away). For example, if you see this:
> http://rubyurl...
>
> you should be able to reverse-engineer it to this
> http://www.rub...

This comes down to an issue of how compressible urls are. I think most
(if not all) of the url shortening sites use the fact that urls people
submit are sparse in the space of all urls, and just keep assigning them
arbitrary generated symbols; I don't think an algorithmically reversible
scheme would be possible when you consider some of the huge
server-state-carrying urls that webapps generate. As a quick experiment
I catted this example from upthread:

http://www.mapquest.com/maps/map.adp?ovi=1&mqmap.x=300&mqmap.y=......
z8OOUkZWYe7NRH6ldDN96YFTIUmSH3Q6OzE5XVqcuc5zb%252fY5wy1MZwTnT2pu%252bNMj
OjsHjvNlygTRMzqazPStrN%252f1YzA0oWEWLwkHdhVHeG9sG6cMrfXNJKHY6fML4o6Nb0Se
Qm75ET9jAjKelrmqBCNta%252bsKC9n8jslz%252fo188N4g3BvAJYuzx8J8r%252f1fPFWk
PYg%252bT9Su5KoQ9YpNSj%252bmo0h0aEK%252bofj3f6vCP

into a file and tried running some standard compression routines on it -
they didn't do very much.

martin

Martin DeMello

3/14/2005 6:46:00 PM

0

Kirk Haines <wyhaines@gmail.com> wrote:
> I suppose the downside is just that this makes it easy for someone to scan
> the database of URLs?

http://marnanel.org/writing/tinyur...

martin