Class: DailyTrending::Scraper
- Inherits:
-
Object
- Object
- DailyTrending::Scraper
- Defined in:
- lib/daily_trending/scraper.rb
Class Method Summary collapse
Class Method Details
.make_apps ⇒ Object
8 9 10 11 12 13 |
# File 'lib/daily_trending/scraper.rb', line 8 def self.make_apps scrape_play_store.each do |a| DailyTrending::App.new_from_index(a) end DailyTrending::App.all end |
.scrape_app(app_url) ⇒ Object
15 16 17 |
# File 'lib/daily_trending/scraper.rb', line 15 def self.scrape_app(app_url) Nokogiri::HTML(open(app_url)) end |
.scrape_play_store ⇒ Object
3 4 5 6 |
# File 'lib/daily_trending/scraper.rb', line 3 def self.scrape_play_store doc = Nokogiri::HTML(open("https://play.google.com/store/apps/collection/promotion_3000792_new_releases_apps?clp=SpEBCikKI3Byb21vdGlvbl8zMDAwNzkyX25ld19yZWxlYXNlc19hcHBzEAcYAxpkCl5uZXdfaG9tZV9kZXZpY2VfZmVhdHVyZWRfcmVjczJfdG9waWNfdjFfbGF1bmNoX2FwcHNfVVNfXzE1MTQ0NDgwMDAwMDBfNl9wcm9tb18xNTE0NDkxNzcwMTgwMDAwEAwYAw%3D%3D%3AS%3AANO1ljLrBj0&hl=en")) doc.css('div.card-content.id-track-click.id-track-impression') end |