x
 
Create New Page
 View Previous Changes    ( Last updated by Sue Crocker )

Creating an RSS Page for your Moblog Gallery

I wanted to create an RSS Feed of the images sent from my mobile phone to my site.  From there you can ping twitter via the rss page if you want.

Step One: Create an RSS Page in your templates.
Step Two: popuplate it with the code below, changing your variables to the ones pertaining to your site.

I removed the caption and description because my mobile carrier sends a bunch of junk with each posting.  All I want is the image and title.  And here you have it below.

Notes:
your gallery name and gallery template is the same thing here and should be called whatever your moblog gallery is called.

I had to alter the code so it would be recognized by twitterfeed if you wanted it to post to twitter every hour or so.

{assign_variable:gallery_name="yourmobloggalleryname"}
{assign_variable
:gallery_template="yourmobloggalleryname"}
{exp
:rss:feed weblog="yoursitename"}
<?xml version
="1.0" encoding="{encoding}"?>
<rss version="2.0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<
channel>
<
title>{weblog_name}</title>
<
link>{weblog_url}</link>
<
description>{weblog_description}</description>
<
pubDate>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</pubDate>
<
admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
{exp:gallery:entries gallery="{gallery_name}" orderby="entry_date" rows="10" columns="1"}
{entries}
{row}
<item>
<
title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
<
link>{id_path={gallery_template}/image_med}</link>
<
pubDate>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</pubDate>
<
content:encoded>
<!
[CDATA[<a href="{id_path={gallery_template}/image_full}">
<
img src="{thumb_url}" width="{thumb_width}" height="{thumb_height}" alt="{title}" style="border: 0;" /></a>
]]>
</
content:encoded>

</
item>
{/row}
{
/entries}
{
/exp:gallery:entries}
</channel>
</
rss>
{/exp:rss:feed} 

If you need further help you can consult this document:
http://expressionengine.com/wiki/Gallery_RSS_Template/

Category:RSS
Category:Gallery

Category:EE1

Categories: