Re: Weather info in text format
by "W. Jeffrey Rankin" <jrankin(at)jeffr.net>
|
| Date: |
Mon, 8 Jan 2001 10:53:50 -0500 (EST) |
| To: |
Susan Duncan <sduncan(at)malico.com> |
| Cc: |
hwg-techniques(at)mail.hwg.org |
| In-Reply-To: |
malico |
| |
todo: View
Thread,
Original
|
|
Hi Susan:
Here's a little process I've set up to grab my local weather information,
it's based upon using telnet and Expect (a Unix scripting language that
allows you to automate interactive processes). It's a simple shell script:
#! /opt/sfw/bin/expect -f
spawn telnet rainmaker.wunderground.com
expect "Press Return to continue:"
send "\n"
expect "or enter 3 letter forecast city code-- "
send "day\n"
expect "Press Return to continue, M to return to menu, X to exit:"
send "X\n"
I output this process to a text file. This information is fairly 'raw' so
I would write a Perl or AWK script to take the information to HTML or
XML. I plan to do this myself, and to key off different words and phrases
like "Mostly cloudy" and "Partly sunny" to substitute appropriate
graphics.
There are many ways to do this, of course, maybe my process will spur
some more efficient ideas!
- Jeff
===================================================
Jeff Rankin jrankin(at)jeffr.net
http://www.jeffr.net/
Be Valid To Be Cool
===================================================
On Mon, 8 Jan 2001, Susan Duncan wrote:
> We have a client that wants to include weather information in a 'ticker' window
> on his site. While I know of a number of sites that will give you code so that
> their graphical weather will show up on your site, I don't know of any that you
> can link to for text information that could be included in a ticker window.
>
> Any ideas?
>
> --
> Making the Web Work for You (tm)
> Susan Duncan (sduncan(at)malico.com) Voice: (613) 744-3283
> Director, Internet Development Fax: (613) 744-1825
> http://www.malico.com Toll Free: (877) WEB-PROS
> http://www.OttawaWEB.COM
> MALICO - Graphic Design and Internet Development
> Founders: Ottawa-Hull Chapter-Int'l Webmasters Association
> "Top 50 Web Development Companies in Canada" - Branham Report/National Post
>
>
>
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.