<div dir="ltr"><div>This is a cool little script but for anyone running Debian 8.0 there is a change to the xpath command.  The &#39;-q&#39; argument fails to work.  I have to use this argument structure.</div><div><br></div><div>xpath &quot;$tmpfile&quot; &quot;//div[@class=&#39;main&#39;]/div//text()&quot;<br></div><div><div><br></div><div><br></div><div>Usage:</div><div>/home/mike/perl5/bin/xpath [filename] query</div><div><br></div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 18, 2015 at 10:32 AM, Rob Funk <span dir="ltr">&lt;<a href="mailto:rfunk@funknet.net" target="_blank">rfunk@funknet.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In case you need a command to quickly get the current Franklin County<br>
snow emergency level:<br>
<br>
<br>
#!/bin/sh<br>
# Franklin County Snow Emergency Level<br>
#<br>
# Required commands:<br>
#     curl<br>
#     xpath (from libxml-xpath-perl package)<br>
#     html2, 2xml (both from xml2 package)<br>
<br>
tmpfile=&quot;/tmp/snow-$$.xhtml&quot;<br>
url=<a href="https://sheriff.franklincountyohio.gov/info/snow-emergency-levels.cfm" target="_blank">https://sheriff.franklincountyohio.gov/info/snow-emergency-levels.cfm</a><br>
<br>
xhtml_cleanup() {<br>
    html2 | 2xml<br>
}<br>
<br>
##<br>
<br>
curl -s &quot;$url&quot; | xhtml_cleanup &gt; &quot;$tmpfile&quot;<br>
status=$?<br>
if [ $status -gt 0 ]; then<br>
    rm -f &quot;$tmpfile&quot;<br>
    exit $status<br>
fi<br>
<br>
xpath -q -e &quot;//div[@class=&#39;main&#39;]/div//text()&quot; &quot;$tmpfile&quot;<br>
<br>
rm &quot;$tmpfile&quot;<br>
<br>
#################################################################<br>
<br>
Those two package names are on Ubuntu. YMMV.<br>
<br>
Sending you a message when this changes, or handling other counties,<br>
are left as an exercise for the reader.<br>
<br>
<br>
_______________________________________________<br>
colug-432 mailing list<br>
<a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
<a href="http://lists.colug.net/mailman/listinfo/colug-432" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
</blockquote></div><br></div>