Commit 1606b3bc by Truong Ba Dieu

Test Crawl aws

parent 7f6344da
class VacuumAwsService
def self.item_search(options={})
options[:country_code] ||='GB'
options[:params] ||={}
request = Vacuum.new(options[:country_code])
request.configure(
aws_access_key_id: 'AKIAJ77C4CTZOP7TUVWQ',
aws_secret_access_key: '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',
associate_tag: 'zigexn6400-22'
)
request.item_search(
options[:params]
)
end
end
\ No newline at end of file
...@@ -22,5 +22,7 @@ module VenShop ...@@ -22,5 +22,7 @@ module VenShop
# Do not swallow errors in after_commit/after_rollback callbacks. # Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true config.active_record.raise_in_transactional_callbacks = true
config.autoload_paths += %W(#{config.root}/services)
end end
end end
namespace :crawler do
task :aws => :environment do
# categories name want to craw
# categories = %w(Books Music Electronics Software Kitchen)
# categories.each do |cate|
# end
response = VacuumAwsService.item_search({
params:{
query: {
'Keywords' => 'Architecture',
'SearchIndex' => 'Books'
}
}
})
puts '---------------------------------------------------------------------------------------------'
puts response.data
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment