Skip to content

Instantly share code, notes, and snippets.

View eToThePiIPower's full-sized avatar
💻
Active

Charles Beynon eToThePiIPower

💻
Active
View GitHub Profile

Keybase proof

I hereby claim:

  • I am etothepiipower on github.
@eToThePiIPower
eToThePiIPower / seeds.rb
Created July 8, 2013 18:51
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.
#/db/seeds.rb
require 'open-uri' # Needed to open web urls
Restaurant.delete_all
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