19. February 2008 23:42
by Henrik Stenbæk
1 Comments
When I started out creating this control my idea was to create a Flickr photo plug-in for BlogEngine.Net but after a while I realised that I could just create a traditional ASP.NET user control for reading RSS streams from Flickr. So here it is:
FlickrRSS.ascx the user control that allows you to display Flickr photos on your weblog, homepage or wherever you have an ASP.NET based web application.
The user control supports user, public and group photostreams.
How to use the control
Download the control FlickrRSS.ascx.zip (1,96 kb) and unzip the files to your project (FlickrRSS.ascx and FlickrRSS.ascx.cs).
Register the control in the page where you want to show the pictures:
<%@ Register src="FlickrRSS.ascx" tagname="FlickrControl" tagprefix="onesoft" %>
Add the control to the page:
<onesoft:FlickrControl ID="FlickrControl1" runat="server" />
Properties
| RssType |
The type of rss read from flickr the options are: User, Group, Allpublic |
| FlickrId |
Optional if RssType=Allpublic. Required if RssType is User or Group. This must be a valid Flickr userid or groupid, this is not the same as username or groupname the format is something like 12345678@00, |
| Tags |
Optional. a comma separated list of tags with no spaces eg.: Tags="adam,laura" – find photos tagged with Adam AND Laura |
| NumberOfImages |
The maximum number of images to appear in the control. |
| CacheDuration |
The time in minutes that the RSS result is cached on the server |
Output
The control returns a list of thumbnails in the format:
<ul>
<li>....</li>
<li>....</li>
</ul>
And can easy be formatted with CSS ;-)
<onesoft:FlickrControl ID="FlickrControl1" runat="server" RssType="user"
CacheDuration="10" FlickrId="34434281@N00" NumberOfImages="8"
Tags="celina" />
returns this (after some formatting):
Download
FlickrRSS.ascx.zip (1,96 kb)
Improvements
This control could be better - but how? Any comments and suggestions are welcome.
- The XML read must be asynchronous