Display Facebook Page RSS Feed

Description

Use this code to pull an RSS feed from Facebook for your institution's Page, and display the most recent item in your HTML code.

This feed only includes things posted by your institution, not comments or posts made by others on your Page.

This code also converts some internal Facebook URLs in the post into addresses that can be used from offsite (i.e. "/profile.php?id=49426403878" --> "http://facebook.com/profile.php?id=49426403878").

Code

${esc.hash}set(${esc.dollar}rssTotal = 1)

${esc.hash}pullRSSFeed("http://www.facebook.com/feeds/page.php?format=rss20&id=6420827863")
${esc.hash}set(${esc.dollar}Q = '"')
${esc.hash}foreach(${esc.dollar}content in ${esc.dollar}list)
 
        ${esc.hash}${esc.hash} Make Facebook's odd relative URLs into URLs that work from another site
        ${esc.hash}set(${esc.dollar}content.description = ${esc.dollar}content.description.replaceAll("href=.\/","href=${esc.dollar}{Q}http://www.facebook.com/"))
        ${esc.hash}set(${esc.dollar}content.link = ${esc.dollar}content.link.replaceAll("^\/","http://www.facebook.com/"))
 
        <h3><a href="${esc.dollar}!content.link">${esc.dollar}!content.title</a></h3>
        <p>${esc.dollar}!content.description</p>
${esc.hash}end