ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

RSS - Confused!!!

June 06, 2011 1:09pm

Subscribe [2]
  • #1 / Jun 06, 2011 1:09pm

    MarkTechArc72

    52 posts

    Hi guys,

    I am trying to put together a solution to post entries from a weblog to Facebook, using RSS Graffiti as the interface.  This predicates that I need to generate an RSS feed from within Expression Engine.

    I have found the following clean code:-

    {assign_variable:master_weblog_name="BLOG"}
    {assign_variable:master_weblog_status="OPEN"}
    {assign_variable:master_rss_uri="http://PATH/TO/THIS/RSS/FEED"}
    
    {exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}
    <?xml version="1.0" encoding="{encoding}"?>
    <rss version="2.0"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:atom="http://www.w3.org/2005/Atom">
        <channel>
        <title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
        <link>{weblog_url}</link>
        <description>{weblog_description}</description>
        <dc:language>{weblog_language}</dc:language>
        <dc:creator>{email}</dc:creator>
        <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
        {gmt_date format="%D, %d %M %Y %H:%i:%s %T"}</pubDate>
        <atom:link href="{master_rss_uri}" rel="self" type="application/rss+xml" >   
    {exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks" status="{master_weblog_status}"}
        <item>
          <title>{exp:xml_encode protect_entities="yes"}{title}{/exp:xml_encode}</title>
          <link>{title_permalink=site/index}</link>
          <guid isPermaLink="false">{title_permalink="site/index"}#id:{entry_id}#date:{gmt_entry_date format="%H:%i"}</guid>
          <description><![CDATA[{summary}{body}]]></description>
          {categories}<category>{exp:xml_encode protect_entities="yes"}{category_name}{/exp:xml_encode}</category>
          {/categories}
          {gmt_entry_date format="%D, %d %M %Y %H:%i %T"}</pubDate>
        </item>
    {/exp:weblog:entries}
        </channel>
    </rss>
    {/exp:rss:feed}

    This when I configure the variables, and view the output of the page, I do indeed get an RSS style feed based upon the entries from the chosen weblog.

    The bit I don’t get, is, how can this template be executed so that it generates the RSS XML file onto my server, so that when I run the RSS Graffiti scripts, I can pick up those RSS entries and use them to post to my Facebook page?

    I fully get the RSS module code, and understand what it does, but I am just missing the bit on where the output goes and how do I get it to generate the output to my server.

    As usual, any help is much appreciated.

    BTW - I am on 1.68 EE, and 2.0 isn’t an option at the moment - hence the post here!

    Cheers, Mark.

  • #2 / Jun 06, 2011 4:51pm

    MarkTechArc72

    52 posts

    Ok thick moment has passed, and worked it out.

    First act of stupidity was not setting my template properties correctly, leaving it as a HTML document, and not RSS.  Secondly, my RSS consumer just points to my template and calls it dynamically, and does not require collection of the feed from an XML file on the server.

    So, all working now.

    The rule of thumb here, RTFM!!!!!

    Cheers, Mark.

  • #3 / Jun 07, 2011 4:17am

    John Henry Donovan

    12339 posts

    LOL thanks for the update Mark. Glad you are up and running. Feel free to start a new thread if you have any more questions

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases