Skip to content

Instantly share code, notes, and snippets.

@ryanfitz
Created September 11, 2009 16:06
Show Gist options
  • Save ryanfitz/185386 to your computer and use it in GitHub Desktop.
Save ryanfitz/185386 to your computer and use it in GitHub Desktop.
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