Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RubyURL.com

1 view
Skip to first unread message

Robby Russell

unread,
Mar 14, 2005, 5:45:19 AM3/14/05
to
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/articles/read/7

resulted in having this up a few hours later:

http://rubyurl.com/

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 | ro...@planetargon.com
* 503.351.4730 | blog.planetargon.com
* PHP, Ruby, and PostgreSQL Development
* http://www.robbyonrails.com/
****************************************/

Sam Roberts

unread,
Mar 14, 2005, 9:14:53 AM3/14/05
to
Quoting ro...@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/articles/read/7
>
> resulted in having this up a few hours later:
>
> http://rubyurl.com/

I tried:
http://rubyurl.com/

and got

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

Cheers,
Sam

James Edward Gray II

unread,
Mar 14, 2005, 9:20:46 AM3/14/05
to
On Mar 14, 2005, at 8:14 AM, Sam Roberts wrote:

> I tried:
> http://rubyurl.com/
>
> 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

Martin Ankerl

unread,
Mar 14, 2005, 9:32:12 AM3/14/05
to
>> I tried:
>> http://rubyurl.com/
>> 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

unread,
Mar 14, 2005, 10:16:28 AM3/14/05
to
Hi James,

> > I tried:
> > http://rubyurl.com/
> >
> > 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://rubyurl.com/" in the form field and you will get this
error :)

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

Nikolai Weibull

unread,
Mar 14, 2005, 10:32:24 AM3/14/05
to
* 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.com/" in the form field and you will get
> this error :)

See http://rubyurl.com/4U1Cm 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

unread,
Mar 14, 2005, 10:35:06 AM3/14/05
to
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/articles/read/7
>
> resulted in having this up a few hours later:
>
> http://rubyurl.com/

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://rubyurl.com/2OJCU

you should be able to reverse-engineer it to this
http://www.ruby-doc.org/


Anyways, thanks for the site.

James

Robby Russell

unread,
Mar 14, 2005, 11:02:53 AM3/14/05
to
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.robbyonrails.com/articles/read/7
> >
> > resulted in having this up a few hours later:
> >
> > http://rubyurl.com/
>
> 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,

Kirk Haines

unread,
Mar 14, 2005, 1:23:30 PM3/14/05
to
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.com/2OJCU
>
> you should be able to reverse-engineer it to this
> http://www.ruby-doc.org/

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

unread,
Mar 14, 2005, 1:28:23 PM3/14/05
to
James Britt <jamesUN...@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.com/2OJCU
>
> you should be able to reverse-engineer it to this
> http://www.ruby-doc.org/

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=75&map...
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

unread,
Mar 14, 2005, 1:45:56 PM3/14/05
to
Kirk Haines <wyha...@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/tinyurl-whacking

martin

Thomas Hurst

unread,
Mar 14, 2005, 2:02:37 PM3/14/05
to
* Robby Russell (ro...@planetargon.com) 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/articles/read/7

In my case qurl was a small project to get a bit more used to writing
web applications in Ruby/FCGI. I've found it very fast and reliable;
Ruby seems very well suited to running daemonized applications, which is
a breath of fresh air next to PHP appservers which like to leak until
they explode, despite not maintaining any state to speak of across
requests.

I'm just mapping qurl strings to table ID's using base63 ([0-9a-zA-Z]).
This keeps the mapping as dense as possible (up to 4000 URLs with
2 characters, over quarter of a million with 3), at the expense of
predictability (which can be avoided by randomizing allocation within a
sensible range, but I don't really see the point).

Next step is to optionally generate a link ID which is easy to give to
someone verbally. I have some pronouncable-password generation code
somewhere, maybe that could help...

If qurl is down, btw, it's probably because the server is getting
senile. It "lost" the network interface a few days ago and needed
rebooting, which is occasionally decides to do on its own.

> resulted in having this up a few hours later:
>
> http://rubyurl.com/

Nice. It doesn't seem to like data: URI's (Application Error); qurl
allows for pretty freeform URLs up to 64k, letting you "link" to things
like: http://qurl.net/27 (non-IE users only).

> *be gentle..* :-)

Damn, *aborts DDoS tests* ;)

--
Thomas 'Freaky' Hurst
http://hur.st/


Bill Kelly

unread,
Mar 14, 2005, 2:19:17 PM3/14/05
to
From: "Thomas Hurst" <tom....@clara.net>

>
> qurl
> allows for pretty freeform URLs up to 64k, letting you "link" to things
> like: http://qurl.net/27 (non-IE users only).

Heheheheh.... Very nice !!

=D


Regards,

Bill


Kirk Haines

unread,
Mar 14, 2005, 3:30:19 PM3/14/05
to
Martin DeMello wrote:

Sure, but is that a _bad_ thing, or merely a thing? That is, is it a
problem, or just one facet of providing the service in that way?

It looks like Bill Kelly used the same algorithm with qurl.com as I did with
enigo.com/shortlink. It's fast, simple, and provides a great amount of
density to the information.


Kirk Haines

Kirk Haines

unread,
Mar 14, 2005, 4:00:05 PM3/14/05
to
Kirk Haines wrote:

> It looks like Bill Kelly used the same algorithm with qurl.com as I did

Argh. Never type while reading something else. Thomas Hurst is the name
that I wanted there. Appologies.


Kirk Haines

Martin DeMello

unread,
Mar 14, 2005, 10:40:59 PM3/14/05
to
Kirk Haines <wyha...@gmail.com> wrote:
> Martin DeMello wrote:
>
> > Kirk Haines <wyha...@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/tinyurl-whacking
>
> Sure, but is that a _bad_ thing, or merely a thing? That is, is it a
> problem, or just one facet of providing the service in that way?

Just a thing :) More fun than otherwise, IMO.

martin

Robby Russell

unread,
Mar 15, 2005, 10:23:46 AM3/15/05
to
Indeed, it's displaying an error as I have a constraint on the
postgresql table to block things like 'goatse, tubgurl, and rubyurl' in
the table itself. RubyURL was my latest "I should see how quick i can
get something up" project. I should be adding some friendly error
messages when people attempt to submit urls like that.

Otherwise, it seems to be working good... hoping to also get FastCGI
running on the server in the next day or two as well.

In a day and a half:

> # SELECT count(id) FROM rubyurls ;
> count
> -------
> 242

I also hope to add a web service for it so that it can be used by irc bots and such.... in time. :-)

James Britt

unread,
Mar 15, 2005, 3:15:41 PM3/15/05
to
Martin DeMello wrote:
> James Britt <jamesUN...@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.com/2OJCU
>>
>>you should be able to reverse-engineer it to this
>> http://www.ruby-doc.org/
>
>
> 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.

Quite true; this occurred to me after I posed that question. As nice as
it may be to have this reversibility, it doesn't seem quite feasible.
You aren't going to get the size reduction available when using
arbitrary keys handed to URLs as they are needed.

Martin DeMello

unread,
Mar 16, 2005, 12:44:19 AM3/16/05
to
Robby Russell <ro...@planetargon.com> wrote:
> Indeed, it's displaying an error as I have a constraint on the
> postgresql table to block things like 'goatse, tubgurl, and rubyurl' in
> the table itself. RubyURL was my latest "I should see how quick i can

If you're blocking stuff, you should probably block other common
redirect sites like makeashorterlink and tinyurl

martin

Robby Russell

unread,
Mar 16, 2005, 12:51:29 AM3/16/05
to

I could spend days adding filters. I guess at some point, you just have
to trust the public a little bit. ;-)

Right now it's http only. I had noticed at least one entry for
"file:///etc/passwd"

not that it would be bad..but some people might freak out about it. heh

Hal Fulton

unread,
Mar 16, 2005, 12:55:50 AM3/16/05
to
Robby Russell wrote:
>>
>>If you're blocking stuff, you should probably block other common
>>redirect sites like makeashorterlink and tinyurl
>>
>>martin
>
> I could spend days adding filters. I guess at some point, you just have
> to trust the public a little bit. ;-)
>

Had you considered a scheme in which the original
domain name is part of the shortened URL?

http://rubyurl.com/www.yahoo.com:ajZkXDls

That way we could at least confirm what domain we
were directed to.

Just a random idea.


Hal

Robby Russell

unread,
Mar 16, 2005, 1:07:23 AM3/16/05
to

Well, that's an interesting idea. It doesn't quite chop the size down as
much as I would like though..as some domains are much longer than just
www.yahoo.com. What if when you clicked a rubyurl.. it showed a 'you are
being redirected to a site on the following domain... 3..2...1 redirect'

Martin DeMello

unread,
Mar 16, 2005, 1:24:15 AM3/16/05
to
Hal Fulton <hal...@hypermetrics.com> wrote:
>
> Had you considered a scheme in which the original
> domain name is part of the shortened URL?
>
> http://rubyurl.com/www.yahoo.com:ajZkXDls
>
> That way we could at least confirm what domain we
> were directed to.

+1 - slashdot has had great success in cutting down on shock site
trolling by annotating every link with its domain in cleartext.

martin

Robby Russell

unread,
Mar 16, 2005, 2:52:42 AM3/16/05
to

As I mentioned in a previous post. I could have it wait for a few
seconds, show the destination URL and provide the person with a link to
cancel the redirect (maybe have it go back to where they came
from?)..just a back button.

.just a thought. Would that address your concerns? If so, how long
would you be willing to wait for it to redirect?

Cheers,

Martin DeMello

unread,
Mar 16, 2005, 3:21:21 AM3/16/05
to
Robby Russell <ro...@planetargon.com> wrote:
>
> As I mentioned in a previous post. I could have it wait for a few
> seconds, show the destination URL and provide the person with a link to
> cancel the redirect (maybe have it go back to where they came
> from?)..just a back button.
>
> .just a thought. Would that address your concerns? If so, how long
> would you be willing to wait for it to redirect?

There are already sites that do that, though, and it's less elegant than
Hal's idea IMO. Plus this would make a nice differentiator for rubyurl

martin

Mark Hubbart

unread,
Mar 16, 2005, 11:32:49 AM3/16/05
to
On Wed, 16 Mar 2005 15:07:23 +0900, Robby Russell <ro...@planetargon.com> wrote:
> On Wed, 2005-03-16 at 14:55 +0900, Hal Fulton wrote:
> > Robby Russell wrote:
> > >>
> > >>If you're blocking stuff, you should probably block other common
> > >>redirect sites like makeashorterlink and tinyurl
> > >>
> > >>martin
> > >
> > > I could spend days adding filters. I guess at some point, you just have
> > > to trust the public a little bit. ;-)
> > >
> >
> > Had you considered a scheme in which the original
> > domain name is part of the shortened URL?
> >
> > http://rubyurl.com/www.yahoo.com:ajZkXDls
> >
> > That way we could at least confirm what domain we
> > were directed to.
> >
> > Just a random idea.
>
> Well, that's an interesting idea. It doesn't quite chop the size down as
> much as I would like though..as some domains are much longer than just
> www.yahoo.com. What if when you clicked a rubyurl.. it showed a 'you are
> being redirected to a site on the following domain... 3..2...1 redirect'

It could be optional. When your app gets a request, check for
"domain:key" vs "key" format, and verify the domain from the database.
If it matches, forward to the retrieved link, and if it doesn't,
display an error page: "This link's domain doesn't match, still follow
it?"

cheers,
Mark


Robby Russell

unread,
Mar 16, 2005, 11:52:02 AM3/16/05
to

I can probably live with something like that. Was considering having a
few options on the create page. Checkboxed for things like "keep
private"... meaning that I won't display it on the rss feeds/most
popular links, etc. I could add one for 'use domain in url method' or
something.. I'm open to suggestions for proper wording.

http://www.robbyonrails.com/articles/read/12

Cheers,

0 new messages