Skip to content

Instantly share code, notes, and snippets.


Charles Beynon eToThePiIPower

View GitHub Profile

Keybase proof

I hereby claim:

  • I am etothepiipower on github.
eToThePiIPower / seeds.rb
Created Jul 8, 2013
A simple seeds.rb to seed a rails app with data from Yahoo Local. Uses Yahoo's public API so no API key is required.
View seeds.rb
require 'open-uri' # Needed to open web urls
zip = "10006" # Set a search zip
returns_per_term = 5 # How many restaurants to return per query
owner = Owner.first # Need an owner
terms = ["burgers", "italian", "deli", "coffee", "cuban", "japanese", "steakhouse"] # Terms to search for, should all names of categories
terms.each do |term|
# Query the Yahoo Local API