RGiersig's Journal http://use.perl.org/~RGiersig/journal/ RGiersig's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:43:28+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 RGiersig's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~RGiersig/journal/ Handy tools: Web::Scraper and XPather (Firefox) http://use.perl.org/~RGiersig/journal/34954?from=rss <p>So we have this custom monitoring tool that produces a beautiful webpage with a table saying "15 minutes ago all but one of my test requests were fine, 30 mins ago all were fine" etc. Well, we wanted to integrate that into Nagios so we don't have to stare at that screen the whole day. A colleague started off writing a check script using wget and grep. Ugly!</p><p>But I remembered <a href="http://search.cpan.org/~miyagawa/Web-Scraper-0.22/">Web::Scraper</a> from the last YAPC::Vienna, so I'd thought I give it a shot too. Knowing that it can use XPaths I looked if Firefox could tell me the xpath to a certain element. And surely, there is that cool <a href="https://addons.mozilla.org/en-US/firefox/addon/1192">XPather</a> extension!</p><p>So I installed it from the Mozilla extension site, pointed my mouse cursor to that element on the monitoring page I wanted to capture and with a click I had the xpath to that element. Started up the scraper CLI that comes with Web::Scraper and experimented with the xpath until I had all the elements I needed. Plugged everything together in a Nagios check script and was done after maybe 30 minutes.</p><p>Oh well, Web::Scrapers documentation is nearly non-existant, but it is so easy to use that the examples that come with it and <a href="http://www.slideshare.net/miyagawa/webscraper/">this presentation</a> from YAPC::Vienna gave me enough info to get a running start. And of course there is always that old <i>"Use the source, Luke!"</i>...<nobr> <wbr></nobr>;-)</p> RGiersig 2007-11-22T15:09:55+00:00 journal Changes.yml specs v0.01 http://use.perl.org/~RGiersig/journal/34370?from=rss <p>OK, I'll bite. Here is a first rough draft for discussion and brain-storming, please post suggestions for add'l hash keys. Basic format of Changes.yml should be a stream of hashes, each hash defining one release.<br><tt><br>---<br>version: 0.02 # plain number or version string, required<br>released: 2007-09-06 # datestring, required<br>author: Roland Giersig &lt;RGiersig@cpan.org&gt; # release author, required<br>stability: draft # stable | draft, required<br>backward-compatibility: partial # full | partial | none, required<br>breaks-compatibility-in: # list of subs, optional<br> &nbsp; - foo()<br> &nbsp; - bar()<br>bugs-fixed: # list of bugs with references, optional<br> &nbsp; - foo() crashes when given undef parameter &lt;http://rt.cpan.org/Ticket/Display.html?id=1234&gt;<br> &nbsp; - bar() should return "blah"<br>changes: # list of text, required<br> &nbsp; - rearranged arguments to foo()<br> &nbsp; - changed return value of bar()<br>---<br>version: 0.01<br>released: 2007-09-05<br>author: Roland Giersig &lt;RGiersig@cpan.org&gt; # release author, required<br>stability: draft<br>backward-compatibility: none<br>changes:<br> &nbsp; - first release<br>---<br></tt></p> RGiersig 2007-09-07T10:17:24+00:00 cpan