Dave Taylor answers free tech support questions about a wide variety of business and technical topics, including blogging, iphone help, ipod help, AdSense, MySpace, Sony PSP help, Mp3 players, Windows XP, Windows Vista, Linux, SEO, Mac OS X, Facebook, Twitter and LinkedIn.

Accuweather changed, and now the 'weather' script is broken!

A reader writes in to report that Accuweather has changed their Web page layout and the shell script from Wicked Cool Shell Scripts that returns the weather forecast (script #63, weather.sh), is broken.

Dave's Answer: He's right, but amazingly, the fix is less than 25 characters long!

Instead of the embedded sed statement containing:

sed -n '/<font class="sevendayten">/,/[^[:digit:]]<\/font>/p' | \
it should now be replaced with:
sed -n '/Start - Forecast Cell/,/End - Forecast Cell/p'
That's all there is to it.

Of course, this doesn't mean that the scripts that are scraping Web sites from my book won't break again as formats change, but that's why it's so helpful for you to try and step through the scripts so you can understand how the script parses the source and extracts the information needed.

And if something else does break, you can always contact me with specific questions!



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

Looks like Accuweather has entered some embedded comments with Real????[TM] in the source. The do not show up in the rendered html page, but they are in the source as comments.

Example:
96. Max. UV 6.-->

Since the script is not set to parse out the comment I get this garbage:

Today
Sunshine, very warm and humid - High 89
96. Max. UV 6.-->

Is there a way to fix it where I can display the "Real" info properly?

Also can I scrub it so it does not appear in the output? Just in case the "Real" info is not wanted.

Thanks - Paco

Posted by: Paco at November 10, 2005 2:18 PM


I have a lot to say, but ...
Starbucks coffee cup I have a lot to say, and questions of my own for that matter, but most of all I'd like to say thank you for all your efforts on this Web site by buying you a chai!

I do have a comment, now that you mention it!









Remember personal info?


Please note that I will never send you any unsolicited commercial email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Uniblue: Free Virus Scan


Join Me At:
Aloha Social Media Summit, Oct 2008


Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Join the List!
Join my author info mailing list, where you'll learn about my upcoming books, speaking gigs, and more!


Book Links
© 2002 - 2008 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]