Talk:Feed.publishTemplatizedAction
From Facebook Developers Wiki
Media:Example.ogg=Questions= I add a profile pic link (directly from facebook's server) image link to image_1 and its not showing up under the mini feed preview console... whats going on?
Sainath Tankasala
Does the 60 character limit for the title_template include the output from the {actor} item? Do the character limits include all of the outputs from the variables in the JSON strings?
Stories are aggregated when they have matching templates and data; however, does this ignore template content (and data) which is not show based on <fb:if-multiple-actors>?
For example, the following two templates would match when aggregated, but don't match on a simple string comparison:
{actor} <fb:if-multiple-actors>have reviewed new films<fb:else>has reviewed "Spiderman 3"</fb:else></fb:if-multiple-actors> {actor} <fb:if-multiple-actors>have reviewed new films<fb:else>has reviewed "Superbad"</fb:else></fb:if-multiple-actors> --Luke 01:58, 11 October 2007 (PDT)
The docs say: The function returns 1 on success, 0 on permissions error, or an error response. However, this method always returns a list of responses for me; always one element, but still a list. Is there a special reason for this? If there are two responses with different response codes, what would this mean?
Typical response:
<feed_publishTemplatizedAction_response list="true">
<feed_publishTemplatizedAction_response_elt>1</feed_publishTemplatizedAction_response_elt>
</feed_publishTemplatizedAction_response>
--UL-Tomten 05:05, 3 December 2007 (PST)
Does the 60 character limit for the title_template include the output from the {actor} item? Do the character limits include all of the outputs from the variables in the JSON strings?
Stories are aggregated when they have matching templates and data; however, does this ignore template content (and data) which is not show based on <fb:if-multiple-actors>?
For example, the following two templates would match when aggregated, but don't match on a simple string comparison:
-
{actor} <fb:if-multiple-actors>have reviewed new films<fb:else>has reviewed "Spiderman 3"</fb:else></fb:if-multiple-actors> -
{actor} <fb:if-multiple-actors>have reviewed new films<fb:else>has reviewed "Superbad"</fb:else></fb:if-multiple-actors>
--Luke 01:58, 11 October 2007 (PDT)
When aggregating, body content and images can come from any one of the aggregated stories, but will the images and content come from the same story as each other, or could the content come from story A, image_1 from story B, and image_2 from story C?
--Luke 01:58, 11 October 2007 (PDT)
Also, can we get some useful examples? It's really not clear how this works.
[edit] Notes
I hate the contradiction of Facebook documentation, please can this be checked before going live guys, i.e. in the developers app it is stated:
these new stories show up in the Mini-Feed of the acting user as well as some of the News Feeds of that user’s friends who have also added your application.
But this is no where to be seen in this wiki documentation and is obviously very important for us devs. Please refine which is true.
I second the above sentiment. Explicit clarfication of this(whether all friends or only app-user friends receive the Newsfeed) in the wiki documentation would be VERY helpful. This came as quite a surprise to us! There is nothing mentioned about it in the PublishActionofUser page nor the PublishActionofUser vs PublishActiontoUser article.
Is it clear how the template "registering" works? Do the text strings just have to match word for word betweeen API Calls and what is submitted from the app page? That seems like a strange approach? Why not put the "publish to other users, don't publish to other users" in the API and then just provide reporting for all templates an app has run. It's not entirely clear to me what the registering provides.
[edit] Examples
It really would be useful if this wiki editors/contributors could provide small code snippets to demonstrate good usage of a function.
Right now I'm a bit lost with this one; I've created my feed templates and tested them, and now I'd like to call them from a PHP page (my app is running in an iFrame).
What code should I use? Something like: $facebook->api_client->feed_publishTemplatizedAction();
But what goes in my brackets? Sorry - lost here.
- A very basic example that might help you get on track:
- $facebook->api_client->feed_publishTemplatizedAction($user, "{actor} <fb:if-multiple-actors>are<fb:else>is</fb:else></fb:if-multiple-actors> testing feed stories", null, null, null, null);
- 502041253 08:06, 20 December 2007 (PST)
[edit] Error
i try simple code like this:
- $facebook->api_client->feed_publishTemplatizedAction($user,"{actor} is testing around",NULL,NULL,NULL,NULL);
but always get error like this:
- Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Feed story title_data argument was not a valid JSON-encoded array' in /***/facebookapi_php5_restlib.php:1520 Stack trace: #0 /***/facebookapi_php5_restlib.php(295): FacebookRestClient->call_method('facebook.feed.p...', Array) #1 /***/filename.php(37): FacebookRestClient->feed_publishTemplatizedAction('1086417xxx', '{actor} is test...', NULL, NULL, NULL, NULL)
please help me how to fix this error.
i use PHP ver. 5.2.4
--768909479 01:45, 14 March 2008 (PDT)
SOLUTION: well publishTemplatizedAction(1st param is user id,2nd param is title template, 3rd param is json data for title.) means u also have to send json data to define {actor}
try sending userid as first, "{actor} is testing around" as second, and "{\"actor\":'<fb:name uid=$user>'}" as 3rd and all rest null;
