You are here

search

Topsy - Real-time Search for the Social web

The other day I was looking for some ways to index the social activity of someone and I bumped on a search service called Topsy. In their own words, "Topsy is a realtime search engine powered by the Social Web. Unlike traditional web search engines, Topsy indexes and ranks search results based upon the most influential conversations millions of people are having every day about each specific term, topic, page or domain queried".

Search an Array in Ruby

If you want to search for a value in an array in Ruby you could do something like this:
 
array = ['Bart','Lisa','Maggie'] array.include?('Homer') # returns false array.include?('Lisa') # returns true
 
Another possibility is to do this:
 
array = ['Bart','Lisa','Maggie'] array.index 'Homer' # returns nil array.index 'Lisa' # returns 1
 
Both methods should work for searching an array.

Subscribe to RSS - search