Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VenShop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Truong Ba Dieu
VenShop
Commits
1606b3bc
Commit
1606b3bc
authored
Jul 14, 2015
by
Truong Ba Dieu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Crawl aws
parent
7f6344da
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
app/services/vacuum_aws_service.rb
+18
-0
config/application.rb
+2
-0
config/application.yml
+0
-0
lib/tasks/crawler.rake
+22
-0
No files found.
app/services/vacuum_aws_service.rb
0 → 100644
View file @
1606b3bc
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
config/application.rb
View file @
1606b3bc
...
...
@@ -22,5 +22,7 @@ module VenShop
# Do not swallow errors in after_commit/after_rollback callbacks.
config
.
active_record
.
raise_in_transactional_callbacks
=
true
config
.
autoload_paths
+=
%W(
#{
config
.
root
}
/services)
end
end
config/application.yml
View file @
1606b3bc
lib/tasks/crawler.rake
0 → 100644
View file @
1606b3bc
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment