code/superant.com.rwdmovies/amazonsearch.rb in rwdmovies-0.93 vs code/superant.com.rwdmovies/amazonsearch.rb in rwdmovies-0.94
- old
+ new
@@ -1,18 +1,24 @@
+begin
require 'amazon/search'
include Amazon::Search
+rescue Exception
+$stderr.print "amazon load error\n"
+$stderr.print "to use amazon search, you need to load ruby-amazon\n"
+end
#amazon search
def runmoviesearch
+begin
req = Request.new(DEV_TOKEN)
testmovie = @a_moviefilename
s = ['keyword_search', "#{testmovie}", 'dvd', HEAVY, ALL_PAGES,'Name']
s.pop
- begin
+
# parse and display the results of each search
response = req.send(*s) { |prod| @moviesearchdisplay = prod, '' }
# printf("Arguments returned from search were:\n\n%s\n", response.args.inspect)
- rescue
+ rescue Exception
print "result error"
end
end
\ No newline at end of file