Sha256: 17d8276f9a70f5df367753c76f3b700e2dbb4157f0a7cfbd505c4e37cb93c7be

Contents?: true

Size: 687 Bytes

Versions: 3

Compression:

Stored size: 687 Bytes

Contents

module AtpScraper
  # Main class
  class Get
    def self.singles_ranking(rank_range = nil)
      request_uri = "/en/rankings/singles?rankRange=#{rank_range}"
      ranking_html = AtpScraper::Html.get(request_uri)
      ranking = AtpScraper::Ranking.new(ranking_html[:html], ranking_html[:charset])
      ranking.pickup_ranking_data
    end

    def self.player_activity(player_id, year)
      request_uri = "/players/anything/#{player_id}/player-activity?year=#{year}&matchType=singles"
      activity_html = AtpScraper::Html.get(request_uri)
      activity = AtpScraper::Activity.new(activity_html[:html], activity_html[:charset])
      activity.pickup_activity_data
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
atp_scraper-0.7.2 lib/atp_scraper/get.rb
atp_scraper-0.7.0 lib/atp_scraper/get.rb
atp_scraper-0.6.3 lib/atp_scraper/get.rb