chrome_store_search 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/chrome_store_search/search.rb +15 -3
- metadata +10 -16
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6f8edd3b6a1153ac7c274d02fd9bf90c4b78bb13
|
4
|
+
data.tar.gz: 7fbb8b3f76beb5f6f06922d7429f8ae3c2b1b47f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1f563c053e20a668adb929e109745fd03426b1513fa1bfe2b306aead612541fc780508f4f7e29aa1dfa211e8b3e55c1679d2dd6c9f3008aa40567a55d12b10d5
|
7
|
+
data.tar.gz: 34c8c15048d605c5b9b1fafab3e45115ec9ec33986dc9eb1f90f80c78f780ce53e1b87ab600eb3662c7602e65f927580cb7a9b1225bd825776af0b46a2daba32
|
@@ -6,7 +6,9 @@ require File.expand_path(File.dirname(__FILE__) + '/app_parser')
|
|
6
6
|
module ChromeStoreSearch
|
7
7
|
class Search
|
8
8
|
|
9
|
-
|
9
|
+
CHROME_STORE_URL = "https://chrome.google.com/webstore/"
|
10
|
+
|
11
|
+
CHROME_STORE_SEARCH_URL = CHROME_STORE_URL + "ajax/item?"
|
10
12
|
|
11
13
|
DEFAULT_SEARCH_CONDITION = {:hl =>"en-US",
|
12
14
|
:count => 20,
|
@@ -30,13 +32,23 @@ module ChromeStoreSearch
|
|
30
32
|
|
31
33
|
def init_query_url
|
32
34
|
query_url = ""
|
33
|
-
query_url <<
|
35
|
+
query_url << CHROME_STORE_SEARCH_URL
|
34
36
|
query_url << "hl=#{@search_condition[:hl]}"
|
35
37
|
query_url << "&count=#{@search_condition[:count]}"
|
36
|
-
query_url << "&pv
|
38
|
+
query_url << "&pv=#{get_pv}"
|
37
39
|
query_url << "&container=CHROME&sortBy=0"
|
38
40
|
query_url << "&category=#{@search_condition[:category]}" if @search_condition[:category]
|
39
41
|
query_url << "&searchTerm=#{CGI.escape(@keyword)}"
|
40
42
|
end
|
43
|
+
|
44
|
+
def get_pv
|
45
|
+
conn = Faraday.new(:url => CHROME_STORE_URL) do |faraday|
|
46
|
+
faraday.request :url_encoded # form-encode POST params
|
47
|
+
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
|
48
|
+
end
|
49
|
+
res = conn.get ''
|
50
|
+
res.body.match(/\/webstore\/static\/(\d+)\/wall/)[1]
|
51
|
+
end
|
52
|
+
|
41
53
|
end
|
42
54
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chrome_store_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Grant Chen
|
@@ -14,33 +13,29 @@ dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.8.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.8.1
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: faraday
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.8.8
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.8.8
|
46
41
|
description: chrome web store apps, extensions and themes search
|
@@ -56,27 +51,26 @@ files:
|
|
56
51
|
- lib/chrome_store_search.rb
|
57
52
|
homepage: https://github.com/grantchen/chrome_store_search
|
58
53
|
licenses: []
|
54
|
+
metadata: {}
|
59
55
|
post_install_message:
|
60
56
|
rdoc_options: []
|
61
57
|
require_paths:
|
62
58
|
- lib
|
63
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
60
|
requirements:
|
66
|
-
- -
|
61
|
+
- - ">="
|
67
62
|
- !ruby/object:Gem::Version
|
68
63
|
version: '0'
|
69
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
65
|
requirements:
|
72
|
-
- -
|
66
|
+
- - ">="
|
73
67
|
- !ruby/object:Gem::Version
|
74
68
|
version: '0'
|
75
69
|
requirements: []
|
76
70
|
rubyforge_project:
|
77
|
-
rubygems_version:
|
71
|
+
rubygems_version: 2.0.3
|
78
72
|
signing_key:
|
79
|
-
specification_version:
|
73
|
+
specification_version: 4
|
80
74
|
summary: chrome web store search
|
81
75
|
test_files: []
|
82
76
|
has_rdoc:
|