Copenda.com - How Are They Doing This?

Does anyone have any thoughts on how Copenda is pulling off search results like this?

http://www.copenda.com/SearchResults.aspx?gender=1&lookingfor=2&ageMin=29&ageMax=36&locatednear=CAMPBELL,%20CA&distance=10&savesearch=1&searchsafe=1&advancedsearch=0&showSearchBox=true

I've looked through the Myspace API docs and from what I can tell you can only pull info for a specific user and they don't support any kind of global search like this result...

Are they page scraping into their own model and THEN querying against that?

Just curious as I've never come across this sort of implementation before.

Thanks!

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.