Re: [WebDNA] Re: parsing xml

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105102
interpreted = N
texte = Thanks, guys. So here's what happens... When I use this: [xmlparse var=3Dxml_var1&source=3Dhttp://gdata.youtube.com/feeds/api/videos= /-/volleyball][/xmlparse] [xmlnode ref=3Dxml_var1] [name]=3D[value] [/xmlnode] I get this: #document=3D When I use this: [tcpconnect host=3Dgdata.youtube.com&port=3D80] [TCPSend]GET /feeds/api/videos/-/volleyball[UnURL]%0D%0A%0D%0A[/UnURL][/TCP= Send] [/tcpconnect] I get this: The requested URL /feeds/api/videos/-/volleyball was not found on this serv= er. I can access the http://gdata.youtube.com/feeds/api/videos/-/volleyball URL through the browser and can see the info I want but just can't seem to figure out how to parse it out. Thanks again. Tana On Wed, Mar 24, 2010 at 9:42 AM, Tom Duke wrote: > Tana, > Hi - you need to use TCPconnect to pull down the feed and then parse the = XML > file based on the format of the returned feed. =A0 Here's a snippet I use= to > pull a list of a user's sets from Flickr - it should give you a starting > point at least. > - Tom > > [!] > [/!][table name=3Dflickrfix&fields=3Dfrom,to] > &amp; & > < < > > > > " " > [/table][!] > > ------------------------------------ > ### =A0Connect to Flickr and pull down set listing =A0### > [/!][TCPConnect host=3Dwww.flickr.com&port=3D80][!] > [/!][text]xmlresponse=3D[TCPSend skipheader=3DT]GET > /services/rest/?method=3Dflickr.photosets.getList&api_key=3D[user_apikey]= &user_id=3D[user_id] > HTTP/1.0[UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend][/text][!] > [/!][/TCPConnect][!] > [/!][xmlparse var=3Dxml_var1][xmlresponse][/xmlparse][!] > > ------------------------------------ > ### =A0Parse the XML =A0### > [/!][xmlnodes ref=3Dxml_var1&path=3Dnamed:rsp][xmlnodes][!] > [/!][replace > db=3D../../data/db_imageminder/flickrSets.db&eqIDdatarq=3D[xmlnodeattribu= tes][showif > [index]=3D1][value][/showif][/xmlnodeattributes]&append=3DT][xmlnodeattri= butes][name]=3D[value]&[/xmlnodeattributes][xmlnodes][grep > search=3D<([^>]*)>([^<]*)]*>&replace=3D\1][content][/grep]=3D[url][c= onvertwords > table=3Dflickrfix][grep > search=3D<([^>]*)>([^<]*)]*>&replace=3D\2][content][/grep][/convertw= ords][/url]&[/xmlnodes][/replace][!] > [/!][/xmlnodes][/xmlnodes] Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Parsing XML...again... (Tana Adams 2010)
  2. Re: [WebDNA] Parsing XML...again... (Christer Olsson 2010)
  3. Re: [WebDNA] Parsing XML...again... (Tana Adams 2010)
  4. Re: [WebDNA] Parsing XML...again... (Grant Hulbert 2010)
  5. Re: [WebDNA] Parsing XML...again... (Christer Olsson 2010)
  6. [WebDNA] Parsing XML...again... (Tana Adams 2010)
  7. Re: [WebDNA] parsing xml (Donovan Brooke 2010)
  8. [WebDNA] parsing xml (Tana Adams 2010)
Thanks, guys. So here's what happens... When I use this: [xmlparse var=3Dxml_var1&source=3Dhttp://gdata.youtube.com/feeds/api/videos= /-/volleyball][/xmlparse] [xmlnode ref=3Dxml_var1] [name]=3D[value] [/xmlnode] I get this: #document=3D When I use this: [tcpconnect host=3Dgdata.youtube.com&port=3D80] [tcpsend]GET /feeds/api/videos/-/volleyball[unurl]%0D%0A%0D%0A[/UnURL][/TCP= Send] [/tcpconnect] I get this: The requested URL /feeds/api/videos/-/volleyball was not found on this serv= er. I can access the http://gdata.youtube.com/feeds/api/videos/-/volleyball URL through the browser and can see the info I want but just can't seem to figure out how to parse it out. Thanks again. Tana On Wed, Mar 24, 2010 at 9:42 AM, Tom Duke wrote: > Tana, > Hi - you need to use TCPconnect to pull down the feed and then parse the = XML > file based on the format of the returned feed. =A0 Here's a snippet I use= to > pull a list of a user's sets from Flickr - it should give you a starting > point at least. > - Tom > > [!] > [/!][table name=3Dflickrfix&fields=3Dfrom,to] > &amp; & > < < > > > > " " > [/table][!] > > ------------------------------------ > ### =A0Connect to Flickr and pull down set listing =A0### > [/!][TCPConnect host=3Dwww.flickr.com&port=3D80][!] > [/!][text]xmlresponse=3D[TCPSend skipheader=3DT]GET > /services/rest/?method=3Dflickr.photosets.getList&api_key=3D[user_apikey]= &user_id=3D[user_id] > HTTP/1.0[unurl]%0D%0A%0D%0A[/UnURL][/TCPSend][/text][!] > [/!][/TCPConnect][!] > [/!][xmlparse var=3Dxml_var1][xmlresponse][/xmlparse][!] > > ------------------------------------ > ### =A0Parse the XML =A0### > [/!][xmlnodes ref=3Dxml_var1&path=3Dnamed:rsp][xmlnodes][!] > [/!][replace > db=3D../../data/db_imageminder/flickrSets.db&eqIDdatarq=3D[xmlnodeattribu= tes][showif > [index]=3D1][value][/showif][/xmlnodeattributes]&append=3DT][xmlnodeattri= butes][name]=3D[value]&[/xmlnodeattributes][xmlnodes][grep > search=3D<([^>]*)>([^<]*)]*>&replace=3D\1][content][/grep]=3D[url][c= onvertwords > table=3Dflickrfix][grep > search=3D<([^>]*)>([^<]*)]*>&replace=3D\2][content][/grep][/convertw= ords][/url]&[/xmlnodes][/replace][!] > [/!][/xmlnodes][/xmlnodes] Tana Adams

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

[WebDNA] Bug? [fileinfo..] You decide (2016) CASTEGORIES IN DIFFERENT FRAMES (1997) [WebDNA] MailChimp (2012) email and W* 4.x (2000) Formvariables + Netscape + Frame Set = Confusion (2000) Multiple Pulldowns (1997) [ShowIf] if the varieable exists (1998) WebCatalog Plug-in for Webstar. (1997) Multiple prices (1997) Creating a back button (1999) this year (2000) MacOS X Server problems (2001) RE: Need Help (1998) 2.1b2 was SLOW ... but 2.1b3 is FAST! (1997) Calendar (1997) OT: Amazon Patents (2000) [WebDNA] Help with WebDNA 7 Install on OS X Lion Server (2011) WebCatalog can't find database (1997) Help! WebCat2 bug (1997) Question about links (1999)