Skip to content

Instantly share code, notes, and snippets.

View VerizonMediaOwner's full-sized avatar

Verizon Media VerizonMediaOwner

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<fantasy_content xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng" xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431/players;player_keys=223.p.5479" time="508.72206687927ms" copyright="Data provided by Yahoo! and STATS, LLC">
<league>
<league_key>223.l.431</league_key>
<league_id>431</league_id>
<name>Y! Friends and Family League</name>
<url>https://football.fantasysports.yahoo.com/archive/pnfl/2009/431</url>
<password>liss</password>
<draft_status>postdraft</draft_status>
<num_teams>14</num_teams>
<?xml version="1.0"?>
<fantasy_content>
<roster>
<coverage_type>week</coverage_type>
<week>13</week>
<players>
<player>
<player_key>242.p.8332</player_key>
<position>WR</position>
<?xml version="1.0" encoding="UTF-8"?>
<fantasy_content xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng" xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/team/253.l.102614.t.10/roster/players" time="110.02206802368ms" copyright="Data provided by Yahoo! and STATS, LLC">
<team>
<team_key>253.l.102614.t.10</team_key>
<team_id>10</team_id>
<name>Matt Dzaman</name>
<url>https://baseball.fantasysports.yahoo.com/b1/102614/10</url>
<team_logos>
<team_logo>
<size>medium</size>
<!--https://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.1/matchups;weeks=1,5-->
<!--Team matchups for weeks 1 and 5 in a NFL H2H league-->
<?xml version="1.0" encoding="UTF-8"?>
<fantasy_content xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng" xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/team/223.l.431.t.1/matchups;weeks=1,5" time="576.54285430908ms" copyright="Data provided by Yahoo! and STATS, LLC">
<team>
<team_key>223.l.431.t.1</team_key>
<team_id>1</team_id>
<name>PFW - Blunda</name>
<url>https://football.fantasysports.yahoo.com/archive/pnfl/2009/431/1</url>
<team_logos>
<!--https://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431-->
<?xml version="1.0" encoding="UTF-8"?>
<fantasy_content xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/league/223.l.431" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" time="181.80584907532ms" copyright="Data provided by Yahoo! and STATS, LLC" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng">
<league>
<league_key>223.l.431</league_key>
<league_id>431</league_id>
<name>Y! Friends and Family League</name>
<url>https://football.fantasysports.yahoo.com/archive/pnfl/2009/431</url>
<draft_status>postdraft</draft_status>
<num_teams>14</num_teams>
<?xml version="1.0" encoding="UTF-8"?>
<fantasy_content xml:lang="en-US" yahoo:uri="http://fantasysports.yahooapis.com/fantasy/v2/game/nfl" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" time="30.575037002563ms" copyright="Data provided by Yahoo! and STATS, LLC" xmlns="http://fantasysports.yahooapis.com/fantasy/v2/base.rng">
<game>
<game_key>257</game_key>
<game_id>257</game_id>
<name>Football</name>
<code>nfl</code>
<type>full</type>
<url>https://football.fantasysports.yahoo.com/f1</url>
<season>2011</season>
<?php
// Copyright 2017 Yahoo Inc. Licensed under the terms of the zLib license see https://opensource.org/licenses/Zlib for terms.
$consumer_key = '<INSERT CONSUMER KEY HERE>';
$consumer_secret = '<INSERT CONSUMER SECRET HERE>';
$o = new OAuth( $consumer_key, $consumer_secret,
OAUTH_SIG_METHOD_HMACSHA1,
OAUTH_AUTH_TYPE_URI );
$url = 'https://fantasysports.yahooapis.com/fantasy/v2/game/nfl';
<?php
///////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Yahoo Inc. Licensed under the terms of the zLib license see https://opensource.org/licenses/Zlib for terms.
// FUNCTION make_write_request
/// @brief Make a write (PUT/POST) request
///
/// @param[out] $auth_failure Sets variable to true on 401 HTTP code (auth)
/// @param[in] $consumer_key Application consumer key
/// @param[in] $consumer_secret Application consumer secret
/// @param[in] $access_token Access token for user/application
<?php
// Copyright 2017 Yahoo Inc. Licensed under the terms of the zLib license see https://opensource.org/licenses/Zlib for terms.
// **** POTENTIAL CONFIGURATION STARTS HERE ****
// MODIFY: Insert your own consumer key and secret here!
$consumer_data = array();
$consumer_data['test']['key'] = '<INSERT CONSUMER KEY HERE>';
$consumer_data['test']['secret'] = '<INSERT CONSUMER SECRET HERE>';
<?php
//Copyright 2017 Yahoo Inc. Licensed under the terms of the zLib license see https://opensource.org/licenses/Zlib for terms.
// To use this code, you must have the default PHP OAuth extension installed: https://php.net/oauth
// You you will also need to fill in your own consumer key and secret where specified.
// You should then be able to execute the PHP script from the command line.
// **** POTENTIAL CONFIGURATION STARTS HERE ****