Forum Moderators: open

Message Too Old, No Replies

I Need Major XML Help

         

netsnets

4:06 am on Dec 30, 2004 (gmt 0)

10+ Year Member



So I run a sports website and I've been in talk with a company to provide us with an xml feed of live scores, stats, etc. thing is I dont know squat about xml and i dont want to go overboard in costs outside of what it costs to purchase their xml feed. so i really dont know squat about xml. I know html and do all the basic web work on the site, but dont know if i can handle whats involved in an xml feed.

i guess there needs to be some kind of script to transfer the feed into something usebale on the site? and appparently i need to use a dedicated server. anything else I need?

dmorison

6:49 pm on Dec 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This can get quite involved i'm afraid. Because of the complexity and the number of things that you will need to stitch together in order to do this nobody is going to be able to post a "simply do this" reply to your question. The intention of this post therefore is not really to answer your question - it is just to give you a bunch of keywords that you can go and research in order to figure out what you need to do!

Firstly, you need some kind of server side scripting technology that will allow you to create pages "on the fly" based on stuff that has gone on behind the scenes. Popular examples are PHP [php.net] on Unix / Linux web servers, and Active Server Pages [msdn.microsoft.com] on Microsoft (IIS) servers.

Once you've got the ability to create pages on the fly, you would need to investigate how to retrieve the XML feed from your supplier. It is probably a simple URL that you have to fetch, for example:

[example.com...]

Now, with PHP, you can fetch the contents of that URL simply by using the code:


$xml = file_get_contents("http://www.example.com/feeds/livedata.xml");

That would put your live feed data into a variable called $xml.

On Microsoft ASP/IIS, you could use an object called XMLHTTP to retrieve the feed.

Finally, you have to turn the XML into HTML so that you can include it in the page that you are creating dynamically. The "cool" way to do this is to use something called XSLT (Google it for tons of info) - but that in itself has a steep learning curve. There are easier ways - search for information on PHP/XML and ASP/XML - there are plenty of tutorials out there.

It may get even more complicated as your supplier may put a limit on how frequently you can request the feed; in which case you would need to cache the feed on your server.

I'm not sure why your supplier of the XML feed is insisting on a dedicated server, although it may be to do with security in that they want you to have a fixed IP address and will only serve the feed to IP addresses registered with them. If this is the case, i'm sure you could instead go with a host that will offer you a unique IP even on a shared server.

Hope this helps, even if it's just a little...!

Good luck.

netsnets

7:13 am on Jan 8, 2005 (gmt 0)

10+ Year Member



thanks for all the help. im in a real bind about this. it would be huge for my site to get this feed, and i finally have the money to do it, but it seems like there's a lot involved here..

dmorison

7:23 am on Jan 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Netsnets,

Have you tried asking the company that provides the feed if they offer a beespoke integration service? Another angle I would take up with them is whether they offer less technically demanding levels of integration; such as a live news or sports results box that only requires some JavaScript to be added to your pages.

The BBC do this - you can get their news feeds as XML (RSS) or you can just use a bit of JavaScript to display BBC News headlines on your website.

If that draws a blank, and if it really means a lot to your site then you should think about paying for someone to develop this feature for you. You could try posting in the WebmasterWorld Commercial Exchange [webmasterworld.com]; and there's also plenty of those "freelance jobs offered" exchange websites where you can get work like this done pretty cheaply. Buyer beware of course, i've never used such services myself.

netsnets

5:45 pm on Jan 8, 2005 (gmt 0)

10+ Year Member



yea, the basic java boxes wont really work, and i'm already in line to purchase the lowest package of content that company has to offer. i've thought about paying for the work to be done, i guess im not really sure how much something along these lines cost. i guess ill try the board and see what people say.