Jump to content

Need Help With A Code


cmcigas

Recommended Posts

ok, im pretty sure this is the right spot to put this, but im not to sure. im trying to put an iframe code on my site from another site that has stats for the NFL. When they update there stats, i want the code to update at the same time, if its possible? any help? heres the code

<iframe src="http://www.pro-football-reference.com/play-index/share.cgi?id=4P2d5&output=iframe" width=525 height=155 scrolling=auto>Report Created on <a href="http://www.pro-football-reference.com/"></a></iframe>

edit: also if it is possible and someone can answer the question, can you dumb it down a lot for me? thanks

Link to comment
Share on other sites

<iframe src="http://www.pro-football-reference.com/play-index/share.cgi?id=4P2d5&output=iframe" width="525" height="155" scrolling="auto" id="nfl_iframe">Report Created on <a href="http://www.pro-football-reference.com/"></a></iframe><script type="text/javascript">setInterval(function(){  document.getElementById('nfl_iframe').src = 'http://www.pro-football-reference.com/play-index/share.cgi?id=4P2d5&output=iframe&cache=' + (new Date()).valueOf();}, 60000);</script>

That will update it every minute.

Link to comment
Share on other sites

Ok thank you. I know I should've said this in my first post but I'm going to be using multiple I frames on one pages. Should I just replace the iframe code in the one you gave me or is there something easier? Thanks do much and sorry in not the best with this stuff.Edit: Is there a way to get rid of everything in the iframe except for the table? When it's onmy site it shows up with a bunch of links from the original site and it's annoying and way to big.. Just wondering if thats possible to get rid of thanks.

Link to comment
Share on other sites

the ideal situation would be to somehow see if they offer a service, either an API or RSS feed or something along those lines, wherein you can get only the data, and then you can apply whatever style/display you want. Using an iframe will give you very limited control over the display, as you are literally pulling in their page as is.

Link to comment
Share on other sites

the ideal situation would be to somehow see if they offer a service, either an API or RSS feed or something along those lines, wherein you can get only the data, and then you can apply whatever style/display you want. Using an iframe will give you very limited control over the display, as you are literally pulling in their page as is.
Ok. So I'm pretty sure espn offers an rss feed for the stats which I'm trying to get, when i click on it it brings up a whole page of code, what do I do with that then?
Link to comment
Share on other sites

http://www.google.co...iw=1439&bih=779 edit: in all fairness, I have never parsed an RSS feed myself, but since I believe they are just XML, my approach would be to use a server side language like PHP to make a request to the RSS feed service and ingest the XML into something like XMLDocument. I personally would then parse it into an array so I could return it as JSON for Javascript to read and render on the page.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...