Comment Feed:
♦ RSS
#!/usr/local/bin/ruby -w
require 'amazon/search'
include Amazon::Search
DEV_TOKEN = "Yeah - right" # your development token
req = Request.new(DEV_TOKEN)
search = ['asin_search', '0954828089', HEAVY, 'ASIN']
#search = ['asin_search', '0297851144', HEAVY, 'ASIN']
# parse the results of the search
response = req.send(*search)
# Print current sales rank
file = File.open("c:\\gaia.txt", File::WRONLY|File::APPEND|File::CREAT)
file.print(Time.now.localtime.strftime("%Y-%m-%d,%H:%M"))
file.print(",0954828089,")
file.print( response.products.first.instance_variable_get("@sales_rank"))
file.print("\n")
file.close