Created
May 8, 2009 04:56
-
-
Save famulus/108634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| puts "<table>" | |
| arr_of_arrs.map do |row| | |
| begin | |
| result = google.search(:q => "#{row[0]} ruby gem")[0] | |
| puts "<tr style=\"padding-top:8px\"> | |
| <td>#{row[0]}</td> | |
| <td style=\"padding-top:8px\"><a href=\"#{result.url}\" >#{result.content}</a></td> | |
| </tr>" | |
| rescue SyntaxError => error | |
| rescue => exc | |
| end | |
| end | |
| puts "</table>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment