chrome_store_search 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8ee950a58881adbd6a2fa062661b9c9aecdaeaf
4
- data.tar.gz: a1d15ce90412a2b73b3fc12003a066b3974b5fb2
3
+ metadata.gz: 229cc06f1c0e76c5794332a75091fe2c5ae0c322
4
+ data.tar.gz: ae6eb0e00b87a7b797eb7124ab27b22c9375ac72
5
5
  SHA512:
6
- metadata.gz: dedd9bc7288926c764029f2e356e62c9bed1cc77178db418be34816192f5e4adaae8491df852fdc4f5890d4f5a4ef639c9731ce17039027eff9805a86540f023
7
- data.tar.gz: 780ed65e425986d9f03538a5b5f00c24906c017a4ceac4c746d0a77b65bafc617225b00da2a2e8f658fdfa4d3f05c5ee9fa6e802d07f30a99c23c60e779960a7
6
+ metadata.gz: 30616310fa1fe042c6455f20100c4adcdc2c8596f5c35db7be46b4c1c03a9c64e9520f4e4c224ba0f393c022505be40c41fcfa09c1884ae9451399c3f9ee53cb
7
+ data.tar.gz: a454d0f2d761ced6924439ae537146668657daa3eda663df42f3fcc4c80db790f74f4132c34d5b96029fbf28bd495b12119d8590b2bed020ee234a5765ea2762
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
- require 'net/https'
3
- require 'uri'
4
2
  require 'cgi'
3
+ require 'faraday'
5
4
  require File.expand_path(File.dirname(__FILE__) + '/app_parser')
6
5
 
7
6
  module ChromeStoreSearch
@@ -11,7 +10,6 @@ module ChromeStoreSearch
11
10
 
12
11
  DEFAULT_SEARCH_CONDITION = {:hl =>"en-US",
13
12
  :count => 20,
14
- :pv => 1394218756,
15
13
  :category => nil}
16
14
 
17
15
  def initialize(search_condition = DEFAULT_SEARCH_CONDITION)
@@ -20,8 +18,11 @@ module ChromeStoreSearch
20
18
 
21
19
  def search(keyword)
22
20
  @keyword = keyword
23
- uri = URI.parse(init_query_url)
24
- res = Net::HTTP.post_form(uri,{})
21
+ conn = Faraday.new(:url => init_query_url) do |faraday|
22
+ faraday.request :url_encoded # form-encode POST params
23
+ faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
24
+ end
25
+ res = conn.post '', {}
25
26
  AppParser.parse(res.body)
26
27
  end
27
28
 
@@ -32,11 +33,10 @@ module ChromeStoreSearch
32
33
  query_url << CHROME_STORE_BASE_URL
33
34
  query_url << "hl=#{@search_condition[:hl]}"
34
35
  query_url << "&count=#{@search_condition[:count]}"
35
- query_url << "&pv=#{@search_condition[:pv]}"
36
+ query_url << "&pv=1394218756"
36
37
  query_url << "&container=CHROME&sortBy=0"
37
38
  query_url << "&category=#{@search_condition[:category]}" if @search_condition[:category]
38
39
  query_url << "&searchTerm=#{CGI.escape(@keyword)}"
39
40
  end
40
-
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,7 +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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Chen
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.8.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.8
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.8
27
41
  description: chrome web store apps, extensions and themes search
28
42
  email: kucss@hotmail.com
29
43
  executables: []