class PopflashMatchDownloader::RecentMatchesExtractor

Constants

USER_URL_PREFIX

Public Class Methods

new(user_id) click to toggle source
# File lib/popflash_match_downloader/recent_matches_extractor.rb, line 3
def initialize user_id
  @user_id = user_id
end

Public Instance Methods

find_match_ids() click to toggle source
# File lib/popflash_match_downloader/recent_matches_extractor.rb, line 16
def find_match_ids
  profile_url = USER_URL_PREFIX + @user_id

  doc = Nokogiri::HTML open(profile_url)
  doc.css('a:isMatchLink', MatchLinkCssFilter.new).map do |l|
    l['href'].match(MATCH_LINK_REGEX).captures.first
  end
end