|
|
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.
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!
Related Shell Script Programming articles:
✔ Secretly capture screenshots on my Mac?
When I used to work on a Linux system, there was a utility we had that would let me take screen captures every...
✔ Parsing "id" strings in a Shell Script?Hello Dave. I need a Bash shell script that creates a directories with the group names automatically when user logs in to the...
✔ Copy and Paste from the Mac OS X Command Line?I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...
✔ Script to test line lengths for Twitter compatibility?I've been tasked with writing a series of tweets for a Black Friday marketing campaign and am finding it a bit tricky because...
✔ Shell script to convert lowercase to title case?As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
Shell Script Programming
(Article 3709,
Written by Dave Taylor)
Tagged: Previous: How do you find cool domain names? Next: BlogAds: An Advertising Network specifically for Weblogs Reader Comments To Date: 2Jim said, on February 17, 2010 11:21 AM:
Does accuweather.com have an imbedded virus/popup problem in Adobe reader from some company trying to sell a virus checker program?
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |
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