Closed kryptics closed 7 years ago
I took a look at the yahoo api. But it's for fantasy league and I didn't see any sports scores in the documentation. I looked around for other options but I could not find any free sports stats, and they were actually kind of expensive. It looked like some people are just scraping websites to get the data. Anyway, if anyone knows any free apis for sports stats, please let me know!
@dardub @evancohen will this work??? https://github.com/metral/scores minus the led of course - but can this be implemented into the code some how?
@kryptics There is a url in there for nbc sports api, though it looks like that service isn't available anymore.. That project hasn't had a commit in 2 years.
@dardub ah chucks - what to the drawing board! thanks!
someone just sent me this... what the hell does that mean? lol
$url = 'http://scores.nbcsports.msnbc.com/ticker/data/gamesMSNBC.js.asp?sport=MLB&period=20130413';
$data = file_get_contents($url); $records = json_decode($data);
$xmlDocument = implode("\n", $records->games);
$xmlObjects = simplexml_load_string('<?xml version=\'1.0\'?>
foreach($xmlObjects AS $xml){ // get all attributes foreach($xml->attributes() AS $attribute=>$value){ echo $attribute . ' = '.$value ."\n"; // i.e: gamecode = 330413105 }
// visiting team:
$visitingTeam='visiting-team';
print_r($xml->$visitingTeam);
// get visiting team attributes, like display_name, etc
foreach($xml->$visitingTeam->attributes() AS $attribute => $value){
echo $attribute . ' = '.$value ."\n";
}
}
What it means is that they are scraping the results from the NBC-site. You should first read the disclaimer of their site to see if that's legal at all.
Next to that, the code is PHP, so we would have to convert it to Javascript. Looks like it's just a lot of XML parsing, but we won't know until we try.
I see, i figure this is for personal use anyways... no?
The problem is that the software is open-source. There are numerous cases where companies send cease and desist letters to github because someone tried to integrate their API without respecting the disclaimer or the policy. I'ld rather keep a defensive policy and first ask before doing something.
It seems that other people also tried to achieve this and the same question was raised: https://gist.github.com/criccomini/3805436.
ah good point
https://developer.fantasydata.com/?developer-portal I looked around for a second and found this. it allows a 1000 calls per month for free
That would only let you refresh the data, on average, every 45 min - not enough to really keep up with any games, just to know the results...
Still digging... might this help us? http://sportsdatabase.com/api
It looks like they send back historic data?
Still hacking away i think this is my last try lol - i realize with out API you can't get the scores... BUT! with Google Cards you can - is there anyway we can incorporate google cards to the repo? there ya go for the minds of the smart mirror... @jeffrhap
Migrated to http://feathub.com/evancohen/smart-mirror/+34
Issue will be closed and tracked on feathub moving forward. Please refer to feathub for all future comments on this suggestion.
Evan suggested looking at the weather js - i guess the idea would be to show the current sports scores like in the yahoo sports site maybe across the bottom of the screen, and they would up date automatically. You could just enter the names of sports teams into the config and it would show you scores. (it doesn't have to be yahoo, but at the moment i think thats the only free one, maybe google has one too)![screen shot 2016-02-16 at 8 37 55 pm](https://cloud.githubusercontent.com/assets/12563047/13097176/1bf326bc-d4ed-11e5-8feb-3519650d5c39.png)