Hello Monks
I feel like I had an effective day at least in part because of a physical list I printed up by means of a perl script to set my priorities. I'd like to add some bells and whistles to it and maybe write it up as a meditation, but it lacks a meditation.
I start shopping around on the net for quotes, affirmations, and it turns out, you'd have a harder time generating an affirmation using perl than I thought. Most seem not to know the lexical meanings of the words they employ. I found one that didn't offend my sensibilities, so I submit it as a guinea pig. The idea here is that a person is gonna create his/her own list for the little bit of reading that many of us like to do right when we get up to start the day with mindfulness and gratitude.
The site is http://motivationgrid.com/50-inspirational-quotes-to-live-by/ What I would like this utility to do is get this page and give me a random quote. I've got a pretty good start, but I'm really stuck with how to write the regex that's gonna deal with cutting off what *isn't* the list. I've been reading the treatment of regexes in _Intermediate Perl_ and hope to mirror that syntax and style in a variety of ways in this list-building endeavor. Here's my starter code when I want to ask something from the internet:
#! /usr/bin/perl use warnings; use strict; use 5.010; use WWW::Mechanize::GZip; use HTML::TableExtract qw(tree); use open ':std', OUT => ':utf8'; use Prompt::Timeout; use constant TIMEOUT => 3; use constant MAXTRIES => 25; my $site = 'http://motivationgrid.com/50-inspirational-quotes-to-live- +by/'; my $mech = 'WWW::Mechanize::GZip'->new; $mech->get($site);
Thanks for your comment,
In reply to regex to get random quote by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |