Created
February 26, 2019 16:43
-
-
Save VerizonMediaOwner/279a90382d817bed1fc66e4cfe55788b to your computer and use it in GitHub Desktop.
See https://developer.yahoo.com/fantasysports/guide/ for details
This file contains hidden or 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
<?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'; | |
try { | |
if( $o->fetch( $url ) ) { | |
print $o->getLastResponse(); | |
print "Successful fetch\n"; | |
} else { | |
print "Couldn't fetch\n"; | |
} | |
} catch( OAuthException $e ) { | |
print 'Error: ' . $e->getMessage() . "\n"; | |
print 'Response: ' . $e->lastResponse . "\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment