module BnetScraper::Starcraft2
This module contains everything about scraping Starcraft 2 Battle.net accounts. See ‘BnetScraper::Starcraft2::ProfileScraper` and `BnetScraper::Starcraft2::LeagueScraper` for more details
Constants
- REGIONS
- REGION_DOMAINS
Public Class Methods
This is a convenience method that chains calls to ProfileScraper
, followed by a scrape of each league returned in the ‘leagues` array in the profile_data. The end result is a fully scraped profile with profile and league data in a hash.
See ‘BnetScraper::Starcraft2::ProfileScraper` for more information on the parameters being sent to `#full_profile_scrape`.
@param options - Hash of profile options (url, bnet_id/account/region, etc). See
`BnetScraper::Starcraft::BaseScraper` for more information on hash options.
@return [BnetScraper::Profile] profile_data - Profile
object containing complete profile and league data
# File lib/bnet_scraper/starcraft2.rb, line 42 def self.full_profile_scrape options = {} profile_scraper = ProfileScraper.new options profile = profile_scraper.scrape profile.leagues.each do |league| league.scrape end profile.achievements profile.match_history return profile end
Determine if Supplied profile is valid. Useful for validating now before an async scraping later
@param [Hash] options - account information hash @return [TrueClass, FalseClass] valid - whether account is valid
# File lib/bnet_scraper/starcraft2.rb, line 59 def self.valid_profile? options scraper = BaseScraper.new(options) scraper.valid? end