Verse of the Day - ver 0.5
Here's a very basic verse of the day-type application that I wrote while playing with Perl and the Tk module. This version is platform independent, ie, it works with Windows, Linux, Solaris, Mac OS X, etc.
In order to run this under Windows, you must have ActiveState Perl installed and have the Tk module installed. It may already be installed.
For Mac OS X, X11 needs to be running with Perl and the Tk module installed.
For all other *NIX platforms, Perl needs to be there as well as the Tk module.
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use XML::Simple;
use Tk;
use Text::Wrap;
my ($content,$ref,$verse,$title);
my ($passage,$mw,$button,$column);
$Text::Wrap::columns = 40;
# Uncomment and modify the next line if you use a proxy
# $ua->proxy('http', '');
$content = get("http://www.gnpcb.org/esv/share/rss2.0/daily/")
or die "Couldn't get URL: $!\n";
$ref = XMLin($content);
$verse = $ref->{channel}->{item}->{description};
$title = $ref->{channel}->{description};
$passage = $ref->{channel}->{item}->{title};
$verse = wrap('', '', $verse);
$mw = new MainWindow(-background => "#FFFFFF");
$mw -> title($title);
$mw -> Label(-background => "#FFFFFF",
-text => "$verse\n\t\t$passage\n")
-> pack(-ipady => "10",
-ipadx => "30");
$button = $mw -> Button(-text => "Quit",
-command => sub { exit; } )
-> pack(-expand => "1",
-fill => "x",);
MainLoop;
















