Comments (10)
Bob,
I've not found any free source for player injury data, but I may be able to pull "news" for players using the nfl fantasy api (http://api.fantasy.nfl.com/v1/docs/service?serviceName=playersNews). Do you think that might be of use? I could possibly parse the content for words related to player injuries.
from fflproject.
I have a script we used in our league that worked good on the lineup submit page. If I have time when I get home i'll see if I can post it here.
from fflproject.
Lets see what Darrend1 has otherwise if the injury news from the api could be parsed so it pops the injury note or icon next to the player in the main team view at least that would be good.
from fflproject.
How confident are you in the nflgame stats vs the api stats going forward?
from fflproject.
Ill edit this with the code later when I get to my server. But essentially it pulls the injury list from rotowire and throws it into a injury table in the database. I currently have the script run a few times a week to pull injuries. Then when the user loads a page, such as the lineup submit page, it pulls the injury data from there while pulling the starting lineups. I have it set to show additional injury info when you mouse over the player. Our site has a lot of custom stuff, so I'm gonna have to cross reference the default files to see what's actually changed. It's not much code to add though, I know that.
I used rotowire due to the details and up to date injury statuses.
from fflproject.
I try to avoid depending on web scraping, do you have a way to get a feed and match up player IDs with rotowire?
I can probably add a table for player history/news that displays on the site and leave it up to you to have a script populate it with data.
As far as nflgame vs the nfl.com fantasy api. When I looked at the fantasy api last year it was not nearly as live as nflgame. That api is intended to write your own interface to manage a nfl.com fantasy league rather than provide stats. So I'll be sticking with nflgame because of the near real-time stats for live scoring.
from fflproject.
I was trying to parse the nfl news api into the database using.
`<?php
url = "http://api.fantasy.nfl.com/v1/players/news";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); //gets the url contents
$data = curl_exec ($ch); // Execute Curl request
curl_close($ch);
$xml = simplexml_load_string($data);
$con=mysql_connect("localhost","root","XXXXXX");
mysql_select_db("ffl_project", $con) or die mysql_error()); //Select Database
foreach ($xml -> note as $row) {
$gsisPlayerId= = $row -> gsisPlayerId;
$body = $row -> body;
$analysis = $row -> analysis;
//perform sql query
$sql = "INSERT INTO injury_table
(gsisPlayerId
, body
,analysis
)"
. "VALUES ('$gsisPlayerId', '$body', '$analysis')";
$result = mysql_query ($sql);
if (!$result) {
echo 'MYSQL ERROR';
} else {
echo 'SUCCESS';
}
}
?>`
But the gsisPlayerId seems to be giving me error.
Here is an example row.
<note id="342839" esbid="GOL705804" gsisPlayerId="00-0024410" firstName="Kedric" lastName="Golston" position="DL" teamAbbr="" source="rotowire" timestamp="2017-05-21 14:21:45"><headline/><body>Golston (hamstring) visited with the 49ers on Friday, Matt Barrows of The Sacramento Bee reports.</body><analysis>Golston, who opened the 2016 season as the Redskins' starting nose tackle but suffered a season-ending hamstring tear in Week 2, was medically cleared from the injury roughly two and a half weeks ago. This meeting with San Francisco marks the first free-agent visit of the offseason for the 33-year-old vet. The 49ers are beginning to construct a fearsome defensive line and Golston would, at the minimum, provide excellent depth and a strong veteran presence.</analysis></note>
from fflproject.
Otherwise I was looking at it in json format.
http://api.fantasy.nfl.com/v1/players/news?format=json
from fflproject.
from fflproject.
I'm going to close this, a basic icon is in develop now and it pulls from nfl.com/injuries. Once I know it's reliable, I'll refine the look over the season. Currently it looks too much like a Cherrio
from fflproject.
Related Issues (20)
- Live Draft watch list doesn't update right HOT 1
- Chat doesn't allow scrolling
- Free Agents not showing up during draft? HOT 2
- Watch list clear bug HOT 1
- Cant reset season / year HOT 9
- cannot get live draft working HOT 1
- player points show 0 when viewing "League -> Players" HOT 2
- no way for user to switch between leagues HOT 2
- Editing Starting Lineup from Admin Screen HOT 1
- Anyone missing Jacksonville players? HOT 2
- Quick Stat for kickers Heading issue HOT 2
- player database inaccuracies HOT 7
- No Issue, just curious...
- Remove Trades offers that can't be completed
- Division settings don't update at season advance
- Draft room player list formatting HOT 2
- Add player watch list to team roster page
- Manage NFL Player data in admin
- Install HOT 1
- Nflgame-redux is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fflproject.