Vote count:
0
I want to retrieve fantasy sports information from yahoo and output the same thing on my own personal website. For example, the standings of the teams and the draft results tables. I'm running into issues though.
First, I only have 60 minutes for using the token until it expires. In my code, I have the access token and token secret filled in as variables and I need to fill it in everytime with new info when they expire. Is there a way to make this an automatic process?
Second, let's say I wanted to query this: select * from fantasysports.leagues.standings where league_key='238.l.627060'. I do get an output on my test site exactly the way YQL console shows (which is really nice! because I just want the output so that I can literally put the same thing on my website). However, the format is unreadable. Is there a nice way to put this in a simple table showing just the name of the teams (along with few other columns would be nice). I have the following code written but the uncommented codes don't output anything at all. Any help???
//print(json_pretty_print($body)); -> this outputs the same thing shown on YQL console
$opp=json_decode($body);
$data = $opp->query->results->league->standings->teams->team;
for($i = 0; $i < $data->count; $i++){
echo 'name: ' . $data->{$i}->name; //prints php
}
Yahoo Fantasy Sports API Token Refresh and Output Format
Aucun commentaire:
Enregistrer un commentaire