apify_core 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +79 -0
- data/LICENSE.txt +22 -0
- data/README.md +43 -0
- data/Rakefile +3 -0
- data/apify_core.gemspec +34 -0
- data/bin/bundler +16 -0
- data/bin/coderay +16 -0
- data/bin/htmldiff +16 -0
- data/bin/ldiff +16 -0
- data/bin/nokogiri +16 -0
- data/bin/pry +16 -0
- data/bin/rackup +16 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/server +16 -0
- data/bin/tilt +16 -0
- data/lib/apify_core/fetcher.rb +190 -0
- data/lib/apify_core/filter.rb +83 -0
- data/lib/apify_core/parser.rb +68 -0
- data/lib/apify_core/version.rb +5 -0
- data/lib/apify_core.rb +19 -0
- data/spec/complex_spec.rb +736 -0
- data/spec/examples/apify_request.json +62 -0
- data/spec/examples/apify_response.json +1399 -0
- data/spec/examples/github_blog_request.json +24 -0
- data/spec/examples/oblomoff_events_request.json +21 -0
- data/spec/examples/vgorode_dn_events_request.json +23 -0
- data/spec/examples/vgorode_dp_events_request.json +23 -0
- data/spec/examples/vgorode_kh_events_request.json +23 -0
- data/spec/examples/vgorode_kiev_events_request.json +23 -0
- data/spec/examples/vgorode_lg_events_request.json +23 -0
- data/spec/examples/vgorode_lviv_events_request.json +23 -0
- data/spec/examples/vgorode_od_events_request.json +23 -0
- data/spec/examples/vgorode_zp_events_request.json +23 -0
- data/spec/spec_helper.rb +8 -0
- metadata +247 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
{
|
2
|
+
"index": {
|
3
|
+
"url": ["http://victorvsk.github.io/apify/"],
|
4
|
+
"js": true
|
5
|
+
},
|
6
|
+
"demo_index": {
|
7
|
+
"from": "from('index') select('.container a')",
|
8
|
+
"js": false,
|
9
|
+
"host": "http://victorvsk.github.io",
|
10
|
+
"pattern": {
|
11
|
+
"hellow_text": "<% .container .jumbotron | first | html %>"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"categories": {
|
15
|
+
"url": [
|
16
|
+
"http://victorvsk.github.io/apify/products/page/2",
|
17
|
+
"http://victorvsk.github.io/apify/products/page/1"
|
18
|
+
],
|
19
|
+
"js": false,
|
20
|
+
"host": "http://victorvsk.github.io",
|
21
|
+
"pattern": {
|
22
|
+
"title": "<% title %>-<% .pagination .active a %>",
|
23
|
+
"customers": {
|
24
|
+
"__iterator__": "#customers ol",
|
25
|
+
"name": "<% a %>",
|
26
|
+
"email": "<% a | first | attr_href %>",
|
27
|
+
"sex": "<% .gender | first | text %>",
|
28
|
+
"purschase_name": "<% .product-name %>",
|
29
|
+
"purschase_count": "<% .badge %>"
|
30
|
+
},
|
31
|
+
"not_in_stock_products": {
|
32
|
+
"__iterator__": "#products .col-xs-6:last ol",
|
33
|
+
"price": "<% .price %>",
|
34
|
+
"image": "<% img | first | attr_src %>",
|
35
|
+
"product_name": "<% ./text()[3] | first | text %>"
|
36
|
+
},
|
37
|
+
"products": {
|
38
|
+
"__iterator__": "//div[@class=\"col-xs-6\" and ./h2/text() = \"In stock\"]/ul/li",
|
39
|
+
"price": "<% .price %>",
|
40
|
+
"image": "<% img | first | attr_src %>",
|
41
|
+
"product_name": "<% a | first | text %>",
|
42
|
+
"link": "<% a | first | attr_href %>"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"products": {
|
47
|
+
"from": "from('categories') select('//div[@class=\"col-xs-6\" and ./h2/text() = \"In stock\"]/ul/li/a')",
|
48
|
+
"js": false,
|
49
|
+
"host": "http://victorvsk.github.io",
|
50
|
+
"pattern": {
|
51
|
+
"name": "<% h1.product-name %>",
|
52
|
+
"images": "<% #images img | mapattr_src %>",
|
53
|
+
"properties": {
|
54
|
+
"__iterator__": "#product_properties tr",
|
55
|
+
"prop_name": "<% td:first %>",
|
56
|
+
"prop_val": "<% td:last %>"
|
57
|
+
},
|
58
|
+
"short_descr": "<% #short_description %>",
|
59
|
+
"descr": "<% #description | first | html %>"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|