Re: [WebDNA] Re: parsing xml

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105101
interpreted = N
texte = --00032555b2a2f4f64204828f7491 Content-Type: text/plain; charset=UTF-8 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. 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=flickrfix&fields=from,to] &amp; & < < > > " " [/table][!] ------------------------------------ ### Connect to Flickr and pull down set listing ### [/!][TCPConnect host=www.flickr.com&port=80][!] [/!][text]xmlresponse=[TCPSend skipheader=T]GET /services/rest/?method=flickr.photosets.getList&api_key=[user_apikey]&user_id=[user_id] HTTP/1.0[UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend][/text][!] [/!][/TCPConnect][!] [/!][xmlparse var=xml_var1][xmlresponse][/xmlparse][!] ------------------------------------ ### Parse the XML ### [/!][xmlnodes ref=xml_var1&path=named:rsp][xmlnodes][!] [/!][replace db=../../data/db_imageminder/flickrSets.db&eqIDdatarq=[xmlnodeattributes][showif [index]=1][value][/showif][/xmlnodeattributes]&append=T][xmlnodeattributes][name]=[value]&[/xmlnodeattributes][xmlnodes][grep search=<([^>]*)>([^<]*)]*>&replace=\1][content][/grep]=[url][convertwords table=flickrfix][grep search=<([^>]*)>([^<]*)]*>&replace=\2][content][/grep][/convertwords][/url]&[/xmlnodes][/replace][!] [/!][/xmlnodes][/xmlnodes] --00032555b2a2f4f64204828f7491 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Tana,

Hi - you need to use TCPconnect to pull down the f= eed and then parse the XML file based on the format of the returned feed. = =C2=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=3Dfro= m,to]
&amp;amp;&amp;
&lt;<
&gt;>
&quot;"
[/table][!]


----------------------------= --------
### =C2=A0Connect to Flickr and pull down set listing =C2=A0###

[/!][TCPConnect host=3Dwww.flickr.com&port=3D80][!]
[/!][text]xmlresponse=3D[T= CPSend 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][!]


------------= ------------------------
### = =C2=A0Parse the XML =C2=A0###

[/!][xmlnodes ref=3D= xml_var1&path=3Dnamed:rsp][xmlnodes][!]

[/!][r= eplace db=3D../../data/db_imageminder/flickrSets.db&eqIDdatarq=3D[xmlno= deattributes][showif [index]=3D1][value][/showif][/xmlnodeattributes]&a= ppend=3DT][xmlnodeattributes][name]=3D[value]&[/xmlnodeattributes][xmln= odes][grep search=3D<([^>]*)>([^<]*)</[^>]*>&repla= ce=3D\1][content][/grep]=3D[url][convertwords table=3Dflickrfix][grep searc= h=3D<([^>]*)>([^<]*)</[^>]*>&replace=3D\2][content= ][/grep][/convertwords][/url]&[/xmlnodes][/replace][!]

[/!][/xmlnodes][/xmlnodes]
--00032555b2a2f4f64204828f7491-- 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)
--00032555b2a2f4f64204828f7491 Content-Type: text/plain; charset=UTF-8 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. 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=flickrfix&fields=from,to] &amp; & < < > > " " [/table][!] ------------------------------------ ### Connect to Flickr and pull down set listing ### [/!][TCPConnect host=www.flickr.com&port=80][!] [/!][text]xmlresponse=[TCPSend skipheader=T]GET /services/rest/?method=flickr.photosets.getList&api_key=[user_apikey]&user_id=[user_id] HTTP/1.0[unurl]%0D%0A%0D%0A[/UnURL][/TCPSend][/text][!] [/!][/TCPConnect][!] [/!][xmlparse var=xml_var1][xmlresponse][/xmlparse][!] ------------------------------------ ### Parse the XML ### [/!][xmlnodes ref=xml_var1&path=named:rsp][xmlnodes][!] [/!][replace db=../../data/db_imageminder/flickrSets.db&eqIDdatarq=[xmlnodeattributes][showif [index]=1][value][/showif][/xmlnodeattributes]&append=T][xmlnodeattributes][name]=[value]&[/xmlnodeattributes][xmlnodes][grep search=<([^>]*)>([^<]*)]*>&replace=\1][content][/grep]=[url][convertwords table=flickrfix][grep search=<([^>]*)>([^<]*)]*>&replace=\2][content][/grep][/convertwords][/url]&[/xmlnodes][/replace][!] [/!][/xmlnodes][/xmlnodes] --00032555b2a2f4f64204828f7491 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Tana,

Hi - you need to use TCPconnect to pull down the f= eed and then parse the XML file based on the format of the returned feed. = =C2=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=3Dfro= m,to]
&amp;amp;&amp;
&lt;<
&gt;>
&quot;"
[/table][!]


----------------------------= --------
### =C2=A0Connect to Flickr and pull down set listing =C2=A0###

[/!][TCPConnect host=3Dwww.flickr.com&port=3D80][!]
[/!][text]xmlresponse=3D[T= CPSend 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][!]


------------= ------------------------
### = =C2=A0Parse the XML =C2=A0###

[/!][xmlnodes ref=3D= xml_var1&path=3Dnamed:rsp][xmlnodes][!]

[/!][r= eplace db=3D../../data/db_imageminder/flickrSets.db&eqIDdatarq=3D[xmlno= deattributes][showif [index]=3D1][value][/showif][/xmlnodeattributes]&a= ppend=3DT][xmlnodeattributes][name]=3D[value]&[/xmlnodeattributes][xmln= odes][grep search=3D<([^>]*)>([^<]*)</[^>]*>&repla= ce=3D\1][content][/grep]=3D[url][convertwords table=3Dflickrfix][grep searc= h=3D<([^>]*)>([^<]*)</[^>]*>&replace=3D\2][content= ][/grep][/convertwords][/url]&[/xmlnodes][/replace][!]

[/!][/xmlnodes][/xmlnodes]
--00032555b2a2f4f64204828f7491-- Tom Duke

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:

Download (1999) remotely add + sign (1997) I have troubles to send message out (1998) nesting limits? (1998) Redirect (2003) Where is f2? (1997) triggers (2003) Javascript/WebCatalog form population (2001) Include vs. lookup? (1998) WebCatalog2 Feature Feedback (1996) Is there a 'does not contain' comparison? (1999) [WebDNA] 30 Minute Cookies (2016) international time (1997) I'm new be kind (1997) Protect and Serve (1999) ExpireDate Zero or Greater than Today (2006) Generating unique SKU from [cart] - FIXED! (1997) Europe, (1998) Word search (1997) WebCat and WebTV (1997)