Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2011, 08:43 PM   #1
Tegan
Connoisseur
Tegan began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Jan 2011
Device: Kindle 1st Gen, Kindle 3 SO
Here's a Tricky One

Weather alerts from http://www.weather.gov/alerts-beta/

I've been able to put just the raw URLs for the various feeds into a recipe and get out a strange result that has the title of the alert as a link (that doesn't seem to work on my Kindle), but I can't figure out how to create a recipe that grabs the whole thing and formats it as plain text.

An example. If you go to http://www.weather.gov/alerts-beta/w...t.php?x=WAZ028 at the moment I'm posting this, you get what looks like a mess of text. It has some formatting, but it doesn't seem to translate over to the browser. And if you put that URL in a recipe, you only get the title. I'd like to get either the full text of the message, or the full text of the message that's linked within the alert.

Here's what a regular entry looks like:

Spoiler:
Code:
<entry>

<id>http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116230800FloodWatch20110118151900WA.PDTFFAPDT.07b8888092a41673923306b255440639</id>
<updated>2011-01-16T15:08:00-08:00</updated>
<published>2011-01-16T15:08:00-08:00</published>
<author>
<name>w-nws.webmaster@noaa.gov</name>
</author>
<title>Flood Watch issued January 16 at 3:08PM PST expiring January 18 at 7:19AM PST by NWS Pendleton http://www.wrh.noaa.gov/pendleton</title>
<link href="http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116230800FloodWatch20110118151900WA.PDTFFAPDT.07b8888092a41673923306b255440639"/>
<summary>...FLOOD WATCH CONTINUES FOR THE WALLA WALLA RIVER NEAR TOUCHET... AT 3 PM SUNDAY AFTERNOON...THE WALLA WALLA RIVER NEAR TOUCHET WAS READING 8.5 FEET AND IS RISING. FLOOD STAGE IS 13 FEET. THE WALLA WALLA RIVER MAY CONTINUE TO RISE TO FLOOD STAGE BY MONDAY AFTERNOON WITH MINOR FLOODING POSSIBLE.</summary>
<cap:effective>2011-01-16T15:08:00-08:00</cap:effective>

<cap:expires>2011-01-18T07:19:00-08:00</cap:expires>
<cap:status>Actual</cap:status>
<cap:msgType>Alert</cap:msgType>
<cap:category>Met</cap:category>
<cap:urgency>Future</cap:urgency>
<cap:severity>Moderate</cap:severity>
<cap:certainty>Possible</cap:certainty>
<cap:areaDesc>Foothills of the Blue Mountains of Washington; Lower Columbia Basin of Washington</cap:areaDesc>
<cap:geocode>

<valueName>FIPS6</valueName>
<value>053005 053013 053021 053039 053071</value>
</cap:geocode>
<cap:parameter>
<valueName>VTEC</valueName>
<value>/O.CON.KPDT.FL.A.0001.110117T1743Z-110118T1519Z/
/TCHW1.0.RS.000000T0000Z.000000T0000Z.000000T0000Z.OO/</value>
</cap:parameter>
</entry>


The link href in there takes you to a page with more detail on the alert. My goal is to get THAT page in as an article.

Here's what a full page of the feed for that region looks like.

Spoiler:
Code:
<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
<?xml-stylesheet href='http://www.weather.gov/alerts-beta/capatom.xsl' type='text/xsl'?>

<!--
This atom/xml feed is an index to active advisories, watches and warnings issued
by the National Weather Service.  This index file is not the complete Common
Alerting Protocol (CAP) alert message.  To obtain the complete CAP alert,
please follow the links for each entry in this index.  Also note the CAP
message uses a style sheet to convey the information in a human readable
format.  Please view the source of the CAP message to see the complete data
set.  Not all information in the CAP message is contained in this index of
active alerts.
-->
<feed
xmlns = 'http://www.w3.org/2005/Atom'
xmlns:cap = 'urn:oasis:names:tc:emergency:cap:1.1'
xmlns:ha = 'http://www.alerting.net/namespace/index_1.0'
>

  <!-- http-date = Sun, 16 Jan 2011 07:30:00 GMT -->
  <id>http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ028</id>
  <generator>
  NWS CAP Server
  </generator>
  <updated>2011-01-16T11:30:00-00:00</updated>

  <author>
  <name>
  w-nws.webmaster@noaa.gov
  </name>
  </author>
  <title>
  Current Watches, Warnings and Advisories for Lower Columbia Basin of Washington (WAZ028) Washington Issued by the National Weather Service
  </title>
  <link href='http://www.weather.gov/alerts-beta/wwaatmget.php?x=WAZ028'/>
<entry>

<id>http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116230800FloodWatch20110118151900WA.PDTFFAPDT.07b8888092a41673923306b255440639</id>
<updated>2011-01-16T15:08:00-08:00</updated>
<published>2011-01-16T15:08:00-08:00</published>
<author>
<name>w-nws.webmaster@noaa.gov</name>
</author>
<title>Flood Watch issued January 16 at 3:08PM PST expiring January 18 at 7:19AM PST by NWS Pendleton http://www.wrh.noaa.gov/pendleton</title>
<link href="http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116230800FloodWatch20110118151900WA.PDTFFAPDT.07b8888092a41673923306b255440639"/>
<summary>...FLOOD WATCH CONTINUES FOR THE WALLA WALLA RIVER NEAR TOUCHET... AT 3 PM SUNDAY AFTERNOON...THE WALLA WALLA RIVER NEAR TOUCHET WAS READING 8.5 FEET AND IS RISING. FLOOD STAGE IS 13 FEET. THE WALLA WALLA RIVER MAY CONTINUE TO RISE TO FLOOD STAGE BY MONDAY AFTERNOON WITH MINOR FLOODING POSSIBLE.</summary>
<cap:effective>2011-01-16T15:08:00-08:00</cap:effective>

<cap:expires>2011-01-18T07:19:00-08:00</cap:expires>
<cap:status>Actual</cap:status>
<cap:msgType>Alert</cap:msgType>
<cap:category>Met</cap:category>
<cap:urgency>Future</cap:urgency>
<cap:severity>Moderate</cap:severity>
<cap:certainty>Possible</cap:certainty>
<cap:areaDesc>Foothills of the Blue Mountains of Washington; Lower Columbia Basin of Washington</cap:areaDesc>
<cap:geocode>

<valueName>FIPS6</valueName>
<value>053005 053013 053021 053039 053071</value>
</cap:geocode>
<cap:parameter>
<valueName>VTEC</valueName>
<value>/O.CON.KPDT.FL.A.0001.110117T1743Z-110118T1519Z/
/TCHW1.0.RS.000000T0000Z.000000T0000Z.000000T0000Z.OO/</value>
</cap:parameter>
</entry>
<entry>
<id>http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116193000WindAdvisory20110118030000WA.PDTNPWPDT.708fb0fcd36cb341bd2a511108f5e8b3</id>
<updated>2011-01-16T11:30:00-08:00</updated>

<published>2011-01-16T11:30:00-08:00</published>
<author>
<name>w-nws.webmaster@noaa.gov</name>
</author>
<title>Wind Advisory issued January 16 at 11:30AM PST expiring January 17 at 7:00PM PST by NWS Pendleton http://www.wrh.noaa.gov/pendleton</title>
<link href="http://www.weather.gov/alerts-beta/wwacapget.php?x=WA20110116193000WindAdvisory20110118030000WA.PDTNPWPDT.708fb0fcd36cb341bd2a511108f5e8b3"/>
<summary>...VERY WINDY TONIGHT THROUGH MONDAY... .A COLD FRONT WILL PUSH EAST OF THE CASCADES TONIGHT. WINDS ALOFT WILL INCREASE AND PRESSURE GRADIENTS WILL TIGHTEN WITH THE PASSAGE OF THE FRONT. THIS WILL RESULT IN VERY WINDY CONDITIONS AND STRONG GUSTY WINDS. ...WIND ADVISORY NOW IN EFFECT FROM 10 PM THIS EVENING TO 7 PM</summary>
<cap:effective>2011-01-16T11:30:00-08:00</cap:effective>
<cap:expires>2011-01-17T19:00:00-08:00</cap:expires>
<cap:status>Actual</cap:status>

<cap:msgType>Alert</cap:msgType>
<cap:category>Met</cap:category>
<cap:urgency>Expected</cap:urgency>
<cap:severity>Minor</cap:severity>
<cap:certainty>Likely</cap:certainty>
<cap:areaDesc>Lower Columbia Basin of Washington</cap:areaDesc>
<cap:geocode>
<valueName>FIPS6</valueName>
<value>053005 053021 053039 053071</value>

</cap:geocode>
<cap:parameter>
<valueName>VTEC</valueName>
<value>/O.EXT.KPDT.WI.Y.0006.110117T0600Z-110118T0300Z/</value>
</cap:parameter>
</entry>
</feed>


My questions:

1) Why am I only getting the title of the alert in the basic recipe?
2) How can I pull the link within an alert entry out and retrieve that file?

Any help would be appreciated. No rush, maybe I'll figure it out myself...
Tegan is offline   Reply With Quote
Old 01-17-2011, 09:53 PM   #2
Tegan
Connoisseur
Tegan began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Jan 2011
Device: Kindle 1st Gen, Kindle 3 SO
Oooh, solved question #1 with help from about five Google searches: I needed to add
use_embedded_content = True
because the content is in XML, and adding that allows the recipe to grab the whole content.

Now to see if I can figure out how to follow that link and get the detailed reports.
Tegan is offline   Reply With Quote
Advert
Old 05-27-2011, 08:49 PM   #3
teriz
Junior Member
teriz began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2010
Device: Kindle 3
can you send it to me?

Hi, I live in Walla Walla, and would love to have a copy of your recipe for the weather, if you have time. Thanks in advance.
teriz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unutterably Silly Tricky Poll GeoffC Lounge 22 05-11-2009 11:24 AM
Tricky Question of the Day: I want a book... where should I buy it? Bob Russell Which one should I buy? 34 09-17-2007 03:30 PM


All times are GMT -4. The time now is 02:03 PM.


MobileRead.com is a privately owned, operated and funded community.