Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Desktop program getting web data

by kiat (Vicar)
on May 17, 2005 at 00:30 UTC ( [id://457617]=perlquestion: print w/replies, xml ) Need Help??

kiat has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

I'm trying to have a Windows program (like MSN messenger) which is started at startup. I would like that program to display some values from the website for the particular user, without he or she having to log in using a browser.

To wit, let's say I've a script on the server as follows:

http://localhost/index.pl?node=fetch_data&whois=tim

So I would like the .exe program to access that script to get the values for tim and display them.

My question is: What sort of output should the server script produce for reading by the .exe program? An xml file containing the data values? A textfile?

How is it normally done?

Thanks in advance :)

Replies are listed 'Best First'.
Re: Desktop program getting web data
by mrborisguy (Hermit) on May 17, 2005 at 00:36 UTC
    i would say whatever data you think you will be able to parse! since you control both programs, it looks like this one is up to you. i'd say go with an xml file though... i hate to say it's because it's popular, 'cause that's never been the way that i am, but it seems like that is the way to go. (okay, okay, it's popular because it's useful, which is the good reason to use it).
      Thanks :)

      So the script has to output a physical file for the external program to access right?

Re: Desktop program getting web data
by TheStudent (Scribe) on May 17, 2005 at 01:27 UTC
    I would have to agree with mrborisguy and sugest xml. Not just because it is popular, but because it is a format that will allow for easy extension and enhancement as your requirements change. We all know that initial solutions always grow as both the user and the developer envision new ways to use and enhance it. XML provides an easy mechanism to allow for this growth and the tools are there to efficiently grow the solution with the requirements.

    TheStudent
Re: Desktop program getting web data
by jhourcle (Prior) on May 17, 2005 at 02:25 UTC

    It's normally done with whatever you feel comfortable in.

    Lots of people use xml these days, or some more specific XML formats (like RDF/RSS/Atom, etc)

    I have no idea what it is that you're trying to do, and what sort of info you're trying to pass. XML can be a very inefficient interchange format. If you're passing around a lot of small values, you can end up using more bandwidth for your structures than for your actual values. (especially for RPC/Encoded SOAP).

    You know how likely the information that you need is going to change, and how much control you have over both ends of the process. I would assume that you'd want to work in something that you can easily work with to serialize and deserialize your data.

    Some people will pass plain text, and parse it. Others will use a data exchange format (LDIF, XML, whatever), and others will pass along formatting information, too (HTML, etc.)

    Yes, this could be a good learning experience, for you to force yourself to learn something new, but depending on how important the process is, it might be better to stick with the familiar.

Re: Desktop program getting web data
by Cap'n Steve (Friar) on May 17, 2005 at 05:28 UTC
    Everyone has already pointed out that XML can be useful, but only if you're not sure exactly how much data you'll be receiving or how it'll be arranged. For something that will always be in the same order, I usually just use a tab-delimited string.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://457617]
Approved by moot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-24 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found