Index: Utils.pm
===================================================================
--- Utils.pm	(revision 717)
+++ Utils.pm	(working copy)
@@ -5,6 +5,7 @@
 $VERSION = '0.08';
 
 use Carp qw( croak );
+use Flickr::API;
 use CGI::Wiki;
 use CGI::Wiki::Formatter::UseMod;
 use CGI::Wiki::Plugin::RSS::Reader;
@@ -127,6 +128,20 @@
                   my $link_title = $_[2] || "View all pages in $_[0] $_[1]";
                   return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>);
                 },
+        qr/\[\[Image:(\d+)(?:\|(s|m|l))?(?:\|(.*))?\]\]/i =>
+             sub {
+                my ($wiki, $id, $size, $style) = @_;
+                $size = $size || "s";
+                
+                my $api = new Flickr::API({'key'    =>  $config->flickr_key,
+                               'secret' => $config->flickr_auth_token});
+                my $response = $api->execute_method('flickr.photos.getInfo', {
+                        'photo_id' => $id
+                      });
+                my $data = $response->content();
+                $data =~ m/<photo id="(.*?)" secret="(.*?)" server="(.*?)"/;
+                return qq(<a href='http://www.flickr.com/photos/openguidetoboston/$id/'><img src='http://static.flickr.com/$3/$1_$2_$size.jpg' style='$style' /></a>);
+             },
         qr/\@INDEX_LIST\s+\[\[(Category|Locale)\s+([^\]]+)]]/ =>
              sub {
                    my ($wiki, $type, $value) = @_;
