Last active
January 5, 2016 19:23
-
-
Save shoorick/4510228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
=head1 USAGE | |
./panoramio-rss.pl | |
=head1 DESCRIPTION | |
Get RSS feed of my photos from panoramio.com and make HTML list of images | |
=head1 AUTHOR | |
Alexander Sapozhnikov | |
L<< http://shoorick.ru/ >> | |
L<< E<lt>shoorick@cpan.orgE<gt> >> | |
=cut | |
# CREATED: 09.01.2013 10:48:05 | |
use warnings; | |
use strict; | |
use utf8; | |
use open qw( :std :utf8 ); | |
use LWP::Simple; | |
my $content = get('http://www.panoramio.com/userfeed/105569'); | |
die "Could not get RSS feed\n" | |
unless defined $content; | |
while ( $content =~ s{<item>(.+?)</item>}{}s ) { | |
local $_ = $1; | |
my ( $title ) = m{<title>(.+?)( / .+?)?</title>}; | |
my ( $link ) = m{<link>(.+?)</link>}; | |
my ( $src ) = m{<media:thumbnail\s+url="(.+?)"}; | |
print qq{<a href="$link"><img src="$src" alt="$title" title="$title"></a> }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment