Skip to content

Instantly share code, notes, and snippets.

@famulus
Created May 8, 2009 05:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save famulus/108660 to your computer and use it in GitHub Desktop.
require 'fastercsv'
require 'google-rest'
arr_of_arrs = FasterCSV.read("/Users/famulus/Desktop/gem_download_stats.csv") # in the interest of dirty hack I just made a CSV of the data
google = GoogleSearch.new
arr_of_arrs.map do |row|
begin
result = google.search(:q => "#{row[0]} ruby gem")[0]
puts "<div style=\"margin-top:10px\">
#{row[0]}</div>
<div style=\"margin-top:5px\"><a href=\"#{result.url}\" >#{result.content}</a></div>"
rescue SyntaxError => error
rescue => exc
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment