Created
September 11, 2009 16:06
-
-
Save ryanfitz/185386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'httparty' | |
require 'pp' | |
module NflKnockout | |
class Client | |
include HTTParty | |
format :xml | |
base_uri 'http://football.myfantasyleague.com' | |
def get_schedule_for_week(week) | |
self.class.get("/2009/export", :query => {:TYPE => 'nflSchedule', :W => week}) | |
end | |
end | |
end | |
c = NflKnockout::Client.new | |
res = c.get_schedule_for_week(1) | |
res["nflSchedule"]["matchup"].each do | match | | |
puts " #{match["team"][0]["id"]} vs #{match["team"][1]["id"]} " | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment