This past week Facebook added a new method on their REST server for sending news and mini feed stories. The method is “feed.publishTemplatizedAction” and the intent of this method is to replace the existing “feed.publishActionOfUser” with a method that is more “templatized”. Here is a sample we created which is a combination of static text and data we gathered from a RSS feed. When a users first installs our application we will publish this news story.
1
2
3
4
5
6
7
8
9
10
11
12
13
| actor_id: 555555555
title_template: {actor} <fb:if-multiple-actors>are<fb:else>is</fb:else>
</fb:if-multiple-actors> exploring the web’s premier collection of
student-produced digital media Made on a Mac.
title_data:
body_template: <b>"{title}"</b> Made by <i>{author}</i>
- See it at the <a href="http://url/item.php?itemID={id}">
Apple Student Gallery</a>
body_data: {"title":"Lost", "author":"Jared A. Jaworski","id":13243}
body_general:
image_1: http://url/resize3.php?image=/109.jpg
image_1_link: http://url/resize4.php?image=/109.jpg
target_ids: |

As illustrated in the sample, if multiple users publish stories where both the title_template and body_template markup strings are identical, as well as the title_data and body_data arrays, then Facebook may aggregated the stories together. When this occurs, the {actor} token is replaced with the names of all of the users whose actions are being aggregated. Also note, that the only valid HTML tags supported in the template is the <a>, <b> and <i>.
For more information check out Facebooks wiki at Feed.publishTemplatizedAction