using XML directly from the web rather than a file?
using XML directly from the web rather than a file?
- Subject: using XML directly from the web rather than a file?
- From: "David A. Cox" <email@hidden>
- Date: Mon, 12 Feb 2007 17:05:17 -0800
I am looking to parse and use data stored in XML available from a web
source. I can deal with the data if I first write the data to a local
xml document, and then read it in using the System Events xml
support. But dealing with all that disk IO for a quick lookup of data
seems like not the best answer. I would rather be able to download
and use the data directly inside the script, but it seems to treat
the xml data as a string rather than an xml object, and I using
things like the "as xml data" do not seem to work. If I am missing
something simple here, I would love a pointer in the right direction.
I think I have run myself in about as many circles as I can on web
searches :).
A sample of what I am doing at this point is:
--clear out the file
try
do shell script "rm /tmp/galacticaText"
end try
--fill the file with xml data
do shell script "curl 'http://galacticaa.net/widget/feed.php?
ts=1171327909000&v=2.1' > /tmp/galacticaText"
--read in the data, and break it out into variables we can use later
in the script
tell application "System Events"
set GalacticaXML to XML file "/tmp/galacticaText"
set {EpNum, EpName, EpType, EpIm, EpM, EpD, EpY, EpFul, EpSum,
NewVer, UpgradeMessage} to value of XML elements of XML element
"galacticaa" of GalacticaXML
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden