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:

Searching for all records (1998) sendmail formatting (2001) WebCat2b13MacPlugin - [math][date][/math] problem (1997) Email notification to one of multiple vendors ? (1997) Error 11 (1996) Web Developer Product Awards (1997) Is this possible in simple search? question? (1998) MacAuthorize and WebMerchant (1997) Almost a there but..bye bye NetCloak (1997) Math Help (2000) Car Database (2002) Re:2nd WebCatalog2 Feature Request (1996) $Quit, $CloseDatabase corrections (1997) Nested vs conditional (1997) [WebDNA] reCAPTCHA and WebDNA (2010) [OT] Mail Error code 573?? (2006) Rounding problem (1998) WebDelivery downloads alias, not original ? (1997) PCS Frames (1997) Sorting by date (1997)