Skip to content

Instantly share code, notes, and snippets.

@shoorick
Last active January 5, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoorick/4510228 to your computer and use it in GitHub Desktop.
Save shoorick/4510228 to your computer and use it in GitHub Desktop.
#!/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