You are here:  » XML Feed via telnet


XML Feed via telnet

Submitted by JohnnyBoy on Tue, 2007-06-19 14:42 in

My question I have is that the xml feed I have is from a telnet feed and needs to be captured and then an xml file would be created to show the feed... Thats before I can use magic parser to display the data.... I can connect to the telnet using a regular telnet window and view the constant feed... my question is how to I go about storing the feed to an xml file in order to display it..

thanks in advance
johnnny

Submitted by support on Tue, 2007-06-19 15:09

Hi johnny,

Obtaining a feed via Telnet is not something that I have any experience of, but I would have thought you could script something up using PHPs fsockopen() functions. This is tricky because you have to code in the sending of your username, password etc. and then the commands you need in order to retrieve the feed. There is some example code for getting data via Telenet on the PHP website...

http://uk.php.net/manual/en/function.fsockopen.php

Something I would also suggest is to investigate whether there is an alternative way to obtain this feed, for example via FTP. It might be worth contacting whoever is providing this feed for you and asking for a more suitable method for accessing the feed. It is available via FTP, you can include FTP authentication within a filename parameter (which you can parse to MagicParser_parse()), for example:

ftp://username:password@ftp.example.com/path/to/file.xml

Hope this helps!
Cheers,
David.