Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set site language explicitly.

  • Loading branch information...
commit 443f1987866921bb1271768d1a33ad2044775400 1 parent 66c071c
@iwakura iwakura authored
View
2  lib/market_bot/android/app.rb
@@ -148,7 +148,7 @@ def initialize(app_id, options={})
end
def market_url
- "https://play.google.com/store/apps/details?id=#{@app_id}"
+ "https://play.google.com/store/apps/details?id=#{@app_id}&hl=en"
end
def update
View
2  lib/market_bot/android/developer.rb
@@ -20,7 +20,7 @@ def market_urls(options={})
url = "https://play.google.com/store/apps/developer?"
url << "id=#{URI.escape(identifier)}&"
url << "start=#{start_val}&"
- url << "num=12"
+ url << "num=12&hl=en"
results << url
end
View
6 lib/market_bot/android/leaderboard.rb
@@ -55,7 +55,7 @@ def self.parse_editors_choice_page(html)
result[:price_usd] = nil
result[:developer] = snippet_node.css('.attribution').text
result[:market_id] = snippet_node.attributes['data-docid'].text
- result[:market_url] = "https://play.google.com/store/apps/details?id=#{result[:market_id]}"
+ result[:market_url] = "https://play.google.com/store/apps/details?id=#{result[:market_id]}&hl=en"
results << result
end
@@ -84,7 +84,7 @@ def market_urls(options={})
url << "/category/#{category.to_s.upcase}" if category
url << "/collection/#{identifier.to_s}?"
url << "start=#{start_val}"
- url << "&num=24"
+ url << "&num=24&hl=en"
results << url
end
@@ -94,7 +94,7 @@ def market_urls(options={})
def enqueue_update(options={})
if @identifier.to_s.downcase == 'editors_choice' && category == nil
- url = 'https://play.google.com/store/apps/collection/editors_choice'
+ url = 'https://play.google.com/store/apps/collection/editors_choice?&hl=en'
process_page(url, 1)
else
min_rank = options[:min_rank] || 1
View
2  lib/market_bot/android/search_query.rb
@@ -20,7 +20,7 @@ def market_urls(options={})
url = "https://play.google.com/store/search?"
url << "q=#{URI.escape(identifier)}&"
url << "c=apps&start=#{start_val}&"
- url << "num=24"
+ url << "num=24&hl=en"
results << url
end
View
2  spec/market_bot/android/app_spec.rb
@@ -50,7 +50,7 @@ def check_getters(app)
end
it 'should generate market URLs' do
- App.new(test_id).market_url.should == "https://play.google.com/store/apps/details?id=#{test_id}"
+ App.new(test_id).market_url.should == "https://play.google.com/store/apps/details?id=#{test_id}&hl=en"
end
context 'Parsing' do
View
12 spec/market_bot/android/leaderboard_spec.rb
@@ -15,14 +15,14 @@ def stub_hydra(hydra)
(0...4).each do |i|
start = i * 24
response = Typhoeus::Response.new(:code => 200, :headers => '', :body => test_src_pages[i + 1])
- url = "https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=#{start}&num=24"
+ url = "https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=#{start}&num=24&hl=en"
hydra.stub(:get, url).and_return(response)
end
test_src_editors_choice = read_file(File.dirname(__FILE__), 'data', "leaderboard-apps_editors_choice.txt")
response = Typhoeus::Response.new(:code => 200, :headers => '', :body => test_src_editors_choice)
- url = "https://play.google.com/store/apps/collection/editors_choice"
+ url = "https://play.google.com/store/apps/collection/editors_choice?hl=en"
hydra.stub(:get, url).and_return(response)
end
@@ -74,9 +74,9 @@ def check_results(results)
lb = Leaderboard.new(test_id, test_category)
urls = lb.market_urls(:min_page => 1, :max_page => 3)
urls.should == [
- 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=0&num=24',
- 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=24&num=24',
- 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=48&num=24'
+ 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=0&num=24&hl=en',
+ 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=24&num=24&hl=en',
+ 'https://play.google.com/store/apps/category/ARCADE/collection/topselling_paid?start=48&num=24&hl=en'
]
end
@@ -123,7 +123,7 @@ def check_results(results)
app[:price_usd].should == nil
app[:developer].should == 'Vector Unit'
app[:market_id].should == 'com.vectorunit.blue'
- app[:market_url].should == 'https://play.google.com/store/apps/details?id=com.vectorunit.blue'
+ app[:market_url].should == 'https://play.google.com/store/apps/details?id=com.vectorunit.blue&hl=en'
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.