How to post a Recent Activity on Facebook? - facebook

Is it possible to post an activity on facebook? I was thinking of something like this
"Has Posted A Photo <MyWebSite URL Here>" Is it possible? if so how? I've tried looking at the docs but I could not find any.

Yes, it is possible by integrating Open Graph into your application. You would need to create custom Objects and Actions as there is no such Common objects, for photo, available as of now in Open Graph.
You can also look into creating custom stories as per your requirements.
Update
Java third party library that you can use :- Spring Social
You can utilize its method post() to Publish action to /{user-id}/{namespace}:{action-type-name} with the required parameters to create the story.

Related

Get restaurant menu from Page using Facebook Graph API

The problem is to get the link to menu from a Facebook official page of a restaurant.
Here is an example of such page: https://www.facebook.com/freshchoice.bb — there is a link to menu of the restaurant which leads to https://www.facebook.com/download/216155385221332/Facebook%20menu.pdf.
Actually, this link works well even if I remove the name of the file from it, and I understand, that 216155385221332 is an ID of some object. But how can I obtain this ID from the API?
I have already spent two days trying to find a solution for this task and have had no luck.
When I request data from Facebook Graph API, I get tons of information, and I can request any of the fields listed here: https://developers.facebook.com/docs/graph-api/reference/page but there is no 'menu', or 'downloads' field, and I have almost broke my brain trying to find out a way to solve this puzzle.
I don't think there's a way to reach this object if you didn't create it yourself.
There's the restaurant.menu OpenGraph object:
https://developers.facebook.com/docs/reference/opengraph/object-type/restaurant.menu/
but I think only the user who created it can access it programatically.
The page you're referring to probably just uploaded the menu via the Facebook website, and didn't create an OpenGraph object.
Se
https://www.facebook.com/help/533179700126832

tagging system using facebook friend list

My friend and I are working on an app that will use Facebook's friendlist. We're trying to create a tagging system in which people can tag each other...similar to example in screenshot.
Does facebook provide this functionality out-of-box or do I have to create this sort of search/input field? I wasn't sure if I simply have to style something they provide or if I have to make it.
You can't tag people on a just like that.
You have to use Open Graph concepts- Mention Tagging
But if you want to post a photo, then you can tag the people using tag parameter.
Good luck!

Load comments from open graph object into Facebook comments social plugin

I have created a website connected my facebook app. Users can login and post a custom action connected to a custom object with open graph, javascript sdk. This will also post with 'fb:explicitly_shared' set to true so it will generate a post on the users timeline. So these custom objects have their own url and on those pages i want to have the comment plugin. And i want that object page (with the comments plugin) and the post on the users timeline to share comments.
I have tried setting a lot of different things in the "href"-property on the comments plugin but nothing seems to work. However i have managed to get the comments of the timeline post with a call to '/objectid/comments' with FB.api(). I can use that to build my own comments ui, but i rather use the comments social plugin. Is there any way to make it happen?
The Post ID and the Open Graph Object ID are different, so I do not believe that they can share comments. Comments are based off a single Facebook ID. Also, it is not currently possible to write comments to an Open Graph Object from the API (comments plugin only) so you can't really create your own comments plugin for an OG object.

What part of the Facebook Graph API should I use to post content with custom actions?

I am looking to publish similar content to the following snippet from my application:
The most important tidbits here are the following:
a photo
a link
a text blurb
I'm not entirely sure where in the Graph API it makes sense for me to explore to do this. I'd like for it to show up in people's newsfeed that approve the action.
The SocialCam example in your picture is using the Open Graph part of the Facebook API. Open Graph allows you to define custom actions and custom objects for your app. The idea is to allow the user to express more specific, high-level actions beyond like, comment and share. In your example, "watch" is the Open Graph action, which is a build-in Action Type. Video is the Open Graph object, a built-in Object Type. Note that "Object" in this context is a type not an instance.
It is possible to define your app's own actions e.g. "review" and link it to custom objects e.g. "Action Movie", "Comedy" etc. You can also define properties for your actions e.g. "Rating" for a review action.
However, if all you require is a "photo, link and a text blurb" you don't have to use the Open Graph but can use the Graph API. You can post a link to a video or image by issuing a POST to:
graph.facebook.com/USER_ID/feed
with params
message
name (sender's name)
caption
link (your url)
description
picture (url to picture)
where USER_ID is the user who's wall you want to post to.
I'm pretty sure they are have set up a a facebook application and defined an action called "watch" and an object called "video". they then publish it by making a post to facebook's graph api.
Facebook walks you through some of the basics while in the management menus, once you've set up a developer account and created an application
Go through links one by one and having step by step guide from official sources. You will be able to achieve your goal.
https://developers.facebook.com/docs/opengraph/tutorial/
https://developers.facebook.com/docs/customopengraph/walkthrough/
http://developers.facebook.com/docs/opengraph/objects/

Create a Facebook "Like" programmatically?

I'd like to replicate the "Like" button functionality in an iPhone application using a native widget. The URL associated with the Like would be a product page with details on the manufacturer's website. Unfortunately, Facebook's Like Button [1] only supports the iframe version. Is there any way to have a user "Like" a URL without using the Like Button?
[1] http://developers.facebook.com/docs/reference/plugins/like/
There's no API to actually create a Like connection.
Looking at the Facebook Developer info, it appears it is possible to Like an Open Graph Object if it already exists in the Open Graph database. Look for the "/OBJECT_ID/likes" method under the "Publishing" section of the API Reference. It says you can "Like the given object (if it has a /likes connection)".
But I do not believe Facebook provides the ability to create NEW Open Graph objects (for, say, a webpage) programmatically. If anyone knows how to do this, I would be interested to hear about it.
There looks to be an assigned bug about not bing able to create new Graph Objects via the API: http://bugs.developers.facebook.net/show_bug.cgi?id=10714
We want to have our own "Like" system with an additional "Dislike" option, and if the user "Likes" something with our system we want to create a Facebook Like in the background. It seems we will need to pre-Like all of the objects (thousands of pages!) so this won't work for us. :(