Facebook graph api post using "/me/feed" vs "/me/links" - facebook-graph-api

I've recently switch my code to post to facebook from
https://graph.facebook.com/[profile_id]/feed
to
https://graph.facebook.com/[profile_id]/links
Now i'm getting this problem, can anyone help?
- my picture that i accompany with the post is not showing, it look like facebook is defaulting to the first image it find on the link page
http://developers.facebook.com/docs/reference/api/post/
http://developers.facebook.com/docs/reference/api/link/
both of these document allow me to specify a picture, but somehow the "links" one isn't displaying the image.
Thanks in advance

Set correct Open Graph meta tags, especially og:image.

I just resolved similar issue, posted news on website and posted via /links to fanpage resolved in post with wrong image content and "site not found" title.
The issue was related to wrong code sequence. We hooked posting news via fb api in not-so-good place. The post should have been already available but it wasn't and posting to fb api results in immediate request from facebookexternalhit bot to check if it exists. Detailed log analysis shown that ping from facebook was before POST to add news finished, that's why we had messed content there.
Sample content we post, if what I described above is not your case:
content_dict =
{
'picture': 'http://www.czerwonysmok.pl/static/media/uploads/blog/pb_reddragon_all2_poprawiony_czerwony.jpg/',
'message': 'Title \n\n contentcontentcontentcontentcontentcontentcontentcontent ',
'link': 'http://www.czerwony-smok.pl/klub/aktualnosci/rashguard-ze-strony/'}
try:
logger.info("Publishing to facebook: " + str(content_dict))
graph.post(path="%s/links" % settings.FAN_PAGE_ID, **content_dict)

About sharing on my Android app i'm using this code:
Bundle postParams = new Bundle();
postParams.putString("message", "User's custom message above share content");
postParams.putString("name", "The name of the link attachment.");
postParams.putString("description", "The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page.");
postParams.putString("caption","The caption of the link (appears beneath the link name). If not specified, this field is automatically populated with the URL of the link.");
postParams.putString("picture","The URL of a picture attached to this post. The picture must be at least 200px by 200px. See our documentation on sharing best practices for more information on sizes.");
postParams.putString("link", "The link attached to this post");
Refer to the document for detail: https://developers.facebook.com/docs/sharing/reference/feed-dialog/v2.3

Related

(Probable) inconsistency in "id"s returned by facebook Graph API and Realtime Updates?

related to Open Graph api for feed returning inconsistent results
When I publish a post on a page's feed using my App, facebook returns some id in the form of <page_id>_<post_id>, but when the same App receives a Real time Update from the same page—say a like or a comment—the parent_id field of the like or comment contains only the <post_id> part!
Is this a bug or what?
Here is the response from facebook engineers -
This is by design. For a realtime update generated by a comment, the parent_id will just show and not include the page_id.
For specific examples, please refer to our documentation (https://developers.facebook.com/docs/reference/api/page/#realtime) and look under the sub-sections "Feed Example."

Adding link to your facebook app in photo post message

Can anyone tell me how this facebook application was able to make 'MemeGen' a link in this post? I have a photo upload application, and everything works great, but I can't figure out how to stick a link like this in the posts.
This is the markup that they managed to get into the message.
MemeGen
Thanks for any help!
That is obviously not a normal photo upload, but an Open Graph action, which publishes a user generated image – https://developers.facebook.com/docs/opengraph/actions/#usergenerated
(And at that, it is in violation of the rules, because actions are only supposed to post real photos that the user publishing the action took at that very moment with his camera – and I doubt that this particular image with text on it qualifies as such.)

post a link in facebook graph api explorer as a page

i am using graph api explorer and an application to post on the wall of a page of my own
when i use the field message and put in it the link it will be posted as a link string only without the pictures in the link as u post it from outside the graph explorer and the poster will be the name of the page via the application
but when i use the "link" field and put the link in it, it will give the form that i want but the poster will be the name of the account and not the name of the page
1st of all: i am trying the post in the graph api explorer before i use my c# console application that will post to the page wall. if i copy the link of a website page and open the page through facebook and paste the link in the status filed it will automatically generate something like a form that contain the picture and some details and if i click post the status will appear as posted by the page itself and it will contain first the link as a text and then the form that i talked about will appear
if i use the c# sdk and post the status as: fbArgs["message"] = txtT.ToString(); facebook.Post("/PAGE_ID/feed", fbArgs); the post will contain the link only without the form that appears automatically when I post the same string in the facebook page website. if i use the "link" field with the link as a value it will be posted by the name of the account but with the form that i want?
how can i post a link that will generate automatically the form that will be created when u paste a link in the status edit box on the facebook website??
You cal refer to this old stackover flow question: Facebook Graph API PHP SDK posting on page as page
You have to manually specify the meta tags for the link using the parameters:
picture Post thumbnail image (can only be used if link is specified)
name Post name (can only be used if link is specified)
caption Post caption (can only be used if link is specified)
description Post description (can only be used if link is specified)
You can create a post on a Page by issuing an HTTP POST request to
PAGE_ID/feed with the publish_stream and manage_pages permissions and
the following parameters. Additionally, Page posts can also be
scheduled to go live at a future time up to 6 months or can be created
in an "unpublished" state where they are not visible on the pages
timeline or in the page fan's news feeds. Unpublished posts can be
used as Sponsored Stories.
Read more at: http://developers.facebook.com/docs/reference/api/page/#links

Pretty photo like functionality does not share the image as expected due to the #prettyphoto in the url

Facebook like does not work as expected with pretty photo.
Here is my url:
http://somedomain.com/photography/#!prettyPhoto[set_3]/0/ this url show an image in the pretty photo.
What i am seeing is that only till http://somedomain.com/photography/ is shared in the facebook, the link after the # is ignored.
Due to this issue all the images in the photography gallery shows the same like count.
How can i fix the issue?
What does the developers.facebook.com/tools/debug tool say about the links you're trying to share?
An og:url meta tag or, canonical link meta tag, etc will redirect Facebook and may result in metadata being pulled from a page you weren't expecting it to be pulled from

Actions do not appear on timeline

I'm developing an app which publishes actions to the timeline.
On the app settings, I've created the action "post" and use the built in object type "article".
Although my graph actions have not been approved by facebook, that should not be a problem, because I am logged in as the developer of the app.
My article URLs pass facebook's linter with warnings, but no errors.
When my app notifies facebook of the the post action, it appears to succeed. Facebook returns an ID representing the action.
When I use facebook's graph explorer to view that ID, the data appears to be correct, showing the correct action type and object data. (If there's a URL to browse the action on facebook, instead of the graph explorer, I do not know what it is).
Still, with all the above apparently working without errors, I never see the action on my timeline. Whether I browse my own timeline, or when logged in as a friend and another developer of the app, I never see any indication on facebook.com that the action was performed.
What am I missing to make my custom action appear on my timeline page?
I had a similar problem. I was using OG and I could post everything successfully, but the posts didn't appear in timeline, but only in the activity log in Facebook.
I just went to the settings of the action and set "Explicitly Shared: This action can specify the user explicitly shared an action." to ON.
Then in my piece of code I put "true" to the key "fb:explicitly_shared" while creating the OG object.
If no error is being returned it sounds as if there is an issue in your public page that is preventing Facebook from knowing what to post.
Have you double checked your OG: meta tags through Facebook's validation tool [ https://developers.facebook.com/tools/debug ]. While you need all of the values to be filled in, the type bit is the most overlooked and must be setup properly to link to your particular application and corresponding action.
If your OG: data is correct and validating you should also check the detail settings for your action and aggregations. If the phrase / tense bits are not filled in Facebook may be uncertain how to make your post appear back to on the timeline.
Discoverd the problem....
My article page include an article:author tag. The URL in that tag was not visible to anonymous users. So, I'm guessing, facebook visited that author URL and received a HTTP 403.
When I removed the article:author tag, the items started appearing on my timeline.
So be careful with all tags and put all urls through facebook's debug tool.
Hmmm Interesting
Was having the same issue...
Using the XFBML, fb:like with all required og meta tags validating on the linter.
Last month when I liked a 'product' on my website, the post was published on my fb timeline wall no worries. Nice, perfect!
Today after clicking Like, I noticed it wasn't publishing to my timeline wall at all... but was logged in the Activity Feed.
It did however post to my wall if I commented on the Like Button flyout comment section.
Then I found this
"Pages of type article do not have publishing rights, and will not show up on user's profiles because they are not real world objects."
https://developers.facebook.com/docs/opengraphprotocol/#types
I've been getting the same issue with a feed dialog post. The posts can be navigated to directly, but doesn't show on timeline. More details here:
Actions not appearing on timeline
I had a similar problem, but everything was actually working correctly. If you get a returned ID and your article appears in your RECENT ACTIVITY, then all should be good.
The perceived issue, your post not appearing in your timeline, is actually the correct behavior. Your post doesn't appear in your timeline because it should appear in your friends' timeline as an activity that you completed. Once they comment or like it, then it should reappear on your timeline.
For me the issue was the posts doesn't show on timeline for all users except me also it was public !, i fixed it by make turn on application as online to be available to all users