Re: TCPConnect / Current Temperature

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55231
interpreted = N
texte = Why not use the Web Services Wizard? I just whipped this up, but have not tried it yet, but there were plenty weather services available. Sal D'Anna [text]funcCallResponse_XML=[tcpConnect host=glkev.webs.innerhost.com&port=80][!] [/!][tcpSend skipheader=T][!] [/!]POST /glkev_ws/WeatherFetcher.asmx HTTP/1.0 Host: glkev.webs.innerhost.com SOAPAction: "http://www.myasptools.com/GetWeather" Content-type: text/xml; charset="utf-8" Content-length: 302 [ZIP_CODE] [/tcpSend] [/tcpConnect][/text] [!]-- NOTE: the return value (raw XML document) will be stored in [funcCallResponse_XML] --[/!] [!]Example code using XML contexts to parse XML results and re-create the original XML tree.[/!] [xmlparse var=xml_var1][funcCallResponse_XML][/xmlparse] [function name=build_xml_tree] [text secure=false]root=[/text] [xmlnodes [showif [root]=]ref=[var][/showif]] [!] Display the node name and value (if applicable) [/!] [loop start=1&end=[count]]   [/loop] <[name] [XMLNodeAttributes][name]="[value]" [/XMLNodeAttributes]>[hideif [IsContainer]=T][value]</[name]>[/hideif]
[!] If this is a container node (has children), recurse into the child nodes [/!] [showif [IsContainer]=T] [build_xml_tree count=[math][count]+1[/math]&root=F] [/showif] [!] Display the closing node tag after the child nodes have been recursed [/!] [showif [IsContainer]=T] [loop start=1&end=[count]]   [/loop]</[name]>
[/showif] [/xmlnodes] [/function] [!] Now use the new function [/!] RESULT:

[build_xml_tree var=xml_var1&count=0] -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Donovan Brooke Sent: Wednesday, January 07, 2004 11:24 AM To: WebDNA Talk Subject: Re: TCPConnect / Current Temperature Here is a PHP version that supposedly works. I don't know PHP very well so maybe someone can translate it over to WebDNA?? (P.S., this is only the core PHP file) --begin

Weather Port

" METHOD="GET"> ZIP Code:
"); } ELSE { $count = 0; $url = "http://www.weather.com/weather/local/" . $zipcode; while ($count < 1) { ++$count; $fp=fopen($url,"r"); IF (!fp) { echo ("

Couldn't Open Weather.com

"); include ("footer.inc"); exit; } $file=fread($fp,60000); fclose($fp); preg_match("/scroll down for map and 10-day forecast.*/s",$file,$matches); echo ("
"); echo ("
"); $matches[0] = str_replace("
", "", $matches[0]); $matches[0] = str_replace ("scroll down for map and 10-day forecast", "", $matches[0]); echo ($matches[0]); echo ("
"); echo (""); } } } echo ("
This Script Provided Free By WebWorkz Ware. This, and other free scripts are available at http://www.webworkzware.com."); include ("footer.inc"); ?> -- -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: TCPConnect / Current Temperature ( Christer Olsson 2004)
  2. Re: (more) TCPConnect / Current Temperature ( Joe D'Andrea 2004)
  3. Re: TCPConnect / Current Temperature ( Joe D'Andrea 2004)
  4. Re: TCPConnect / Current Temperature ( Clint Davis 2004)
  5. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  6. Re: TCPConnect / Current Temperature ( Christer Olsson 2004)
  7. Re: TCPConnect / Current Temperature ( Christer Olsson 2004)
  8. Re: TCPConnect / Current Temperature ( Rob Marquardt 2004)
  9. Re: TCPConnect / Current Temperature ( Clint Davis 2004)
  10. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  11. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  12. Re: TCPConnect / Current Temperature ( "Sal D'Anna" 2004)
  13. Re: TCPConnect / Current Temperature ( Christer Olsson 2004)
  14. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  15. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  16. Re: TCPConnect / Current Temperature ( devaulw@onebox.com 2004)
  17. Re: TCPConnect / Current Temperature ( devaulw@onebox.com 2004)
  18. Re: TCPConnect / Current Temperature ( Bob Minor 2004)
  19. Re: TCPConnect / Current Temperature ( devaulw@onebox.com 2004)
  20. Re: TCPConnect / Current Temperature ( Donovan Brooke 2004)
  21. Re: TCPConnect / Current Temperature ( Clint Davis 2004)
  22. Re: TCPConnect / Current Temperature ( "Dan Strong" 2004)
  23. Re: TCPConnect / Current Temperature ( Jeff Logan 2004)
  24. TCPConnect / Current Temperature ( Clint Davis 2004)
Why not use the Web Services Wizard? I just whipped this up, but have not tried it yet, but there were plenty weather services available. Sal D'Anna [text]funcCallResponse_XML=[tcpConnect host=glkev.webs.innerhost.com&port=80][!] [/!][tcpSend skipheader=T][!] [/!]POST /glkev_ws/WeatherFetcher.asmx HTTP/1.0 Host: glkev.webs.innerhost.com SOAPAction: "http://www.myasptools.com/GetWeather" Content-type: text/xml; charset="utf-8" Content-length: 302 [ZIP_CODE] [/tcpSend] [/tcpConnect][/text] [!]-- NOTE: the return value (raw XML document) will be stored in [funcCallResponse_XML] --[/!] [!]Example code using XML contexts to parse XML results and re-create the original XML tree.[/!] [xmlparse var=xml_var1][funcCallResponse_XML][/xmlparse] [function name=build_xml_tree] [text secure=false]root=[/text] [xmlnodes [showif [root]=]ref=[var][/showif]] [!] Display the node name and value (if applicable) [/!] [loop start=1&end=[count]]   [/loop] <[name] [XMLNodeAttributes][name]="[value]" [/XMLNodeAttributes]>[hideif [IsContainer]=T][value]</[name]>[/hideif]
[!] If this is a container node (has children), recurse into the child nodes [/!] [showif [IsContainer]=T] [build_xml_tree count=[math][count]+1[/math]&root=F] [/showif] [!] Display the closing node tag after the child nodes have been recursed [/!] [showif [IsContainer]=T] [loop start=1&end=[count]]   [/loop]</[name]>
[/showif] [/xmlnodes] [/function] [!] Now use the new function [/!] RESULT:

[build_xml_tree var=xml_var1&count=0] -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Donovan Brooke Sent: Wednesday, January 07, 2004 11:24 AM To: WebDNA Talk Subject: Re: TCPConnect / Current Temperature Here is a PHP version that supposedly works. I don't know PHP very well so maybe someone can translate it over to WebDNA?? (P.S., this is only the core PHP file) --begin

Weather Port

" METHOD="GET"> ZIP Code:
"); } ELSE { $count = 0; $url = "http://www.weather.com/weather/local/" . $zipcode; while ($count < 1) { ++$count; $fp=fopen($url,"r"); IF (!fp) { echo ("

Couldn't Open Weather.com

"); include ("footer.inc"); exit; } $file=fread($fp,60000); fclose($fp); preg_match("/scroll down for map and 10-day forecast.*/s",$file,$matches); echo ("
"); echo ("
"); $matches[0] = str_replace("
", "", $matches[0]); $matches[0] = str_replace ("scroll down for map and 10-day forecast", "", $matches[0]); echo ($matches[0]); echo ("
"); echo (""); } } } echo ("
This Script Provided Free By WebWorkz Ware. This, and other free scripts are available at http://www.webworkzware.com."); include ("footer.inc"); ?> -- -- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Sal D'Anna"

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:

SendTo more emails (1998) _ in front of field name (1998) Download URL & access on the fly ? (1997) Random Order Sort? (2000) OT: [WAY IN RIGHT FIELD SOMEWHERE] Spam Filters (2005) How do I access a shopping cart once it had been moved into (2000) WebCat b13 CGI -shownext- (1997) Refering page (1998) REPOST: How do _you_ back up your db? (2000) [WriteFile] problems (1997) [CART] inside a [LOOP] (1997) Paths, relative paths, webstar server setup and security (Mac) (1997) Proper file locations (1997) WebCat2 beta 11 - new prefs ... (1997) b12 cannot limit records returned and more. (1997) Re:2nd WebCatalog2 Feature Request (1996) Re:Merging databases (1997) Replace with Producteditor.tpl (2000) Here's how to kill a Butler Database. (1997) docs for WebCatalog2 (1997)