def scrape_user(user_page)
      if user_page.parser.css('.profile_info').empty?
        raise InvalidUserPage, 'The given page does not correspond to any user.'
      else
        infos = user_page.parser.css('.raffle_infomation') #sic
        user_anchor = infos[1].css('a')[0]

        steam_id = extract_steam_id(user_page.uri.to_s)
        username = /TF2R Item Raffles - (.+)/.match(user_page.title)[1]
        avatar_link = infos[0].css('img')[0].attribute('src').to_s

        posrep = infos.css('.upvb').text.to_i
        negrep = infos.css('.downvb').text.to_i

        color = extract_color(user_anchor.attribute('style').to_s)
      end

      {steam_id: steam_id, username: username, avatar_link: avatar_link,
       posrep: posrep, negrep: negrep, color: color}
    end
def scrape_user(user_page)
      if user_page.parser.css('.profile_info').empty?
        raise InvalidUserPage, 'The given page does not correspond to any user.'
      else
        infos = user_page.parser.css('.raffle_infomation') #sic
        user_anchor = infos[1].css('a')[0]

        steam_id = extract_steam_id(user_page.uri.to_s)
        username = /TF2R Item Raffles - (.+)/.match(user_page.title)[1]
        avatar_link = infos[0].css('img')[0].attribute('src').to_s

        posrep = infos.css('.upvb').text.to_i
        negrep = infos.css('.downvb').text.to_i

        color = extract_color(user_anchor.attribute('style').to_s)
      end

      {steam_id: steam_id, username: username, avatar_link: avatar_link,
       posrep: posrep, negrep: negrep, color: color}
    end
Scrapes a user page for information about the user.

 @example
   p = s.fetch('http://tf2r.com/user/76561198061719848.html')
   s.scrape_user(p) #=>
   {:steam_id=>76561198061719848,
    :username=>"Yulli",
    :avatar_link=>"http://media.steampowered.com/steamcommunity/public/images/avatars/bc/bc9dc4302d23f2e2f37f59c59f29c27dbc8cade6_full.jpg",
     :posrep=>11459,
     :negrep=>0,
     :color=>"70b01b"}

 @param user_page [Mechanize::Page] the user page.
 @return [Hash] a representation of the user.
   * :steam_id (+Fixnum+) — the user's SteamID64.
   * :username (+String+) — the user's username.
   * :avatar_link (+String+) — a link to the user's avatar.
   * :posrep (+Fixnum+) — the user's positive rep.
   * :negrep (+Fixnum+) — the user's negative rep.
   * :color (+String+) — hex color code of the user's username.