Game Results on Home Page
Game Results on Home Page
Is there a way to use the API to place game results on the home page of an iscorebaseball.com/teamname site?
- FTMSupport
- Site Admin
- Posts: 13193
- Joined: Sat Mar 28, 2009 7:25 pm
Re: Game Results on Home Page
The API makes the data available for developers to do whatever they want with the data. If you write some kind of plug in that pulls the data through the API and displays it on a web page, you may be able to display it on your home page. We do not have any examples of doing this, but if you are a developer, it should be possible to do.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Re: Game Results on Home Page
I am a developer. Does the stock website have access to php? I'm suggesting accessing get from the Html editor or iframe in the editor? Also is there ftp access?
Thanks
Thanks
- FTMSupport
- Site Admin
- Posts: 13193
- Joined: Sat Mar 28, 2009 7:25 pm
Re: Game Results on Home Page
The team websites do not allow running your own PHP code on our servers, and you do not get FTP access. You can edit the home page through the HTML editor provided. If you need server side code to manipulate the data returned by the API, you would have to provide your own server to do so. If you can do what you are trying to do in javascript, then you should be able to make AJAX calls to the API to get the data and do it all with client code.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Re: Game Results on Home Page
I've done what you had suggested, however, the script stops before getting to 'success'. Any thoughts. This code works fine with others.
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
url: "http://api.iscoresports.com/teamwebsite/cumulativestats.php?s=baseball&t=demobaseballteam&p=demopwd",
data: "json=1",
dataType: "json",
success: function(data) {
alert('Success!');
}
});
});
</script>
- FTMSupport
- Site Admin
- Posts: 13193
- Joined: Sat Mar 28, 2009 7:25 pm
Re: Game Results on Home Page
For data type try "jsonp". Having just "json" will run into cross site scripting issues. The format of the parameter in your data tag is also wrong. It should be {json:1} and you should probably move all the other parameter into the data attribute as well instead of mixing it in the querystring.
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Re: Game Results on Home Page
Thank-you!!! I was using jsonp as a datatype but I was getting an invalid label error, and here it was do to the data attribute. Thanks again.
Jerome
Jerome
Re: Game Results on Home Page
It seems though the datatype is jsonp and the data attribute is set to json:1 the result is XML and not js. And I'm not sure if that is why I would be having trouble getting to the specific attributes.
- FTMSupport
- Site Admin
- Posts: 13193
- Joined: Sat Mar 28, 2009 7:25 pm
Re: Game Results on Home Page
We can not start troubleshooting custom code, but here is a sample page that makes the JSONP call you are trying to make. You can use it as a reference:
http://api.iscorecentral.com/samplejson.html" onclick="window.open(this.href);return false;
http://api.iscorecentral.com/samplejson.html" onclick="window.open(this.href);return false;
Check out the new iScore Baseball documentation page!
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Includes videos and user manual.
http://iscoresports.com/baseball/training.php#docs
Re: Game Results on Home Page
We never asked you , FTM specifically, to troubleshoot code. We posted our question in the iScore forum which we assumed other users help other users as in most support forums. FTM support team answered our initial question and subsequent questions, we did not have your arm twisted behind your back. By your last response we would then assume FTM is not interested in helping developers with Open Source plugins for their products. Good documentation is always helpful not just for the users and developers but to support staff as well. FTM, should learn from others.
Cheers,
Jerome
Cheers,
Jerome
