x
ETF2L is looking for new Staff to recruit! Are you interested in supporting the league? Then click here for more details on what we can offer and how to apply! 

Forum

XML API

Created 25th January 2010 @ 12:53

Add A Reply Pages: 1 2 Next »

LuckyLuke

UbeR |

Hey guys,

On the http://etf2l.org/etf2l/xml-apiXML API[/url] page of the site, you seem to be able to display results of ETF2L on a different webpage. Now my question, how can I get an XML file generated from another link correctly showing on my team’s website?

I’d like to use this one for example: http://etf2l.org/feed/match/?days_ahead=-3&team=7260&show=20

Can someone help me with this? :)

Skyride

DUCS

Theres not really a more constructive way to put this:

l2php

Actually, maybe. You’ll need to learn PHP and make said page on your website in it. If you do want to learn it, heres a REALLY good beginners tutorial:
http://devzone.zend.com/node/view/id/627

Might be a little condescending if you already know another programming language, in which case just skim over it.

ST8

You can do it in javascript too. Check out jquery. Theres an ajax function that can parse xml.

Try this tutorial:
http://www.switchonthecode.com/tutorials/xml-parsing-with-jquery

LuckyLuke

UbeR |

Pff that is hard stuff man. Can’t someone make me a little piece of code in HTML or PHP which shows the XML file on the website like how it should?
Nobody done this on their website?

And it’s possible to do this in HTML (or php), because most websites aren’t XML right? xD


Last edited by LuckyLuke,

Arie

(serveme.tf)
FB
[FB]

Quoted from LuckyLuke

Pff that is hard stuff man. Can’t someone make me a little piece of code in HTML or PHP which shows the XML file on the website like how it should?
Nobody done this on their website?

And it’s possible to do this in HTML (or php), because most websites aren’t XML right? xD

The XML just contains the data, how you want to display it is up to you. You’ll need to write a bit of code that takes the XML, parses it/takes the bits you find interesting and present them in the way you want.

Good luck.

jagbama

бекон

I’m also looking for help on this – converting the timestamp into a readable date lol…

The simple code for returning 1 match result from here http://etf2l.org/feed/match/?team=5964&show=1 I have here: http://pastebin.com/m65fffef9

Returns this: http://www.jagbama.com/jag/New1.php

Fisrt line should be the date/time… any halp pls? Thx :D


Last edited by jagbama,

Jarppa

Feacon

Quoted from jagbama

I’m also looking for help on this – converting the timestamp into a readable date lol…

The simple code for returning 1 match result from here http://etf2l.org/feed/match/?team=5964&show=1 I have here: http://pastebin.com/m65fffef9

Returns this: http://www.jagbama.com/jag/New1.php

Fisrt line should be the date/time… any halp pls? Thx :D

Times are in Unix time, which can be converted to readable format with date.

ST8

Heres a really quick example using jquery:

http://etf2l.org/test/

load that up and view source. Theres really no need for php to parse this.


Last edited by ST8,

LuckyLuke

UbeR |

Oh nice one thanks, going to try that out. :D

Spike Himself

TC

*insert discussion regarding browsers having javascript turned off*


Last edited by Spike Himself,

Jarppa

Feacon

Quoted from Spike Himself

*insert discussion regarding browsers having javascript turned off*

You’re using Lynx?

DeNeusbeer

(Legend)
HoT<3

I doubt people having JavaScript turned off is an issue anymore these days, especially in our target audience.

Spike Himself

TC

Look up some stats – you’d be surprised. There are still many people that have no idea what a computer is for. Maybe someone once told them to turn javascript off to prevent infection from a particular virus (this has actually happened). How would they know/remember to turn it back on again? And that’s just one example.

I’m not saying you shouldn’t use javascript on your site (in fact I wouldn’t know how to cope without it). I’m just pointing out that there are more people with browsers that don’t support it (i.e. have it turned off) than you might realise.

And yes, I do use lynx.

LuckyLuke

UbeR |

Hey guys,

I don’t get any further than “loading…”

http://total-resistance.com/test/

I used the sourcecode what ST8 used in that test (can’t enter etf2l.org/test anymore, but I saved the sourcecode). I made the test directory, I’ve put the sourcecode in a index.html in /test, and the jquery.js in the same directory (/test).
What am I doing wrong?

cheers

Skyride

DUCS

If you call the file .html instead of .php, the PHP parser may not read it depending on the settings of your webserver. Change the file name to index.php and see if it works.

Add A Reply Pages: 1 2 Next »