Danimal | 16 May 22:30

Re: Copenda.com - How Are They Doing This?


wick,

I'm not familiar enough with either (Copenda or Myspace's API), but if
it's just the "fuzzyness" you are looking to replicate, that's easy
enough.

There are two fuzzy things they are doing:

1) age range criteria
2) location criteria

The first one is very straightforward as it's just a matter of
choosing a min and max then doing a conditional query between them.
Looks like you can do:

Person.find(:all, :conditions => { :age => min..max })

(From here: http://dev.rubyonrails.org/changeset/5876http://dev.rubyonrails.org/changeset/5876)

The second one would be pretty easy by using the geokit plugin:
http://geokit.rubyforge.org/ which would let you store lat/long values
as well as find results by using various geographical calculations by
radius.

If your question is more about how they get that data... well, I can't
help you much there. Possibly screen scraping (easy enough... try
hpricot... I've heard that's a useful tool)... or maybe there's
already APIs for getting at the data.

-Danimal

P.S. I like the slider for age selection. That's slick. Gotta use that
idea in some of my own apps.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane