agoragames / bnet_scraper

A Nokogiri-based scraper of Battle.net profiles. Currently this only includes Starcraft2.
MIT License
22 stars 7 forks source link

Refactor Inconsistent API #9

Closed cadwallion closed 11 years ago

cadwallion commented 11 years ago

The API for Profile is very erratic. The scraper holds the data, but makes no attempt to structure the data beyond a basic hash with concentration of data. The API needs to be refactored to consider a Profile, League, etc.

Thoughts on improved API:

ProfileScraper returns a Profile object. Profile has:

Calls to these, unless already retrieved, will scrape the relevant page(s). In addition, give ProfileScraper an option to eager-scrape these subsections. This removes the need to have BnetScraper::Starcraft2.full_scrape and provides a better use-case for the library.

cadwallion commented 11 years ago

Fixed by #10