User Created Open Graph Objects in Facebook App - facebook

I'm trying to build a Facebook App that will run in the Canvas on Facebook. I want to give users the ability to create custom open graph objects. For example I want users to be able to make a donation bucket. Title, Description, amount needed, time left, goal. I want the user to make these and then when someone contributes it will post saying "USER_NAME added to the donation TITLE"
Is it possible for users to create objects in this way? Most of what I've seen is about the developer making objects and users acting on them.

An Open Graph object is basically just an URL, that provides the relevant info via appropriate meta elements.
So where’s the problem? You just provide an URL that provides the data your user entered – this could f.e. just contain an id as GET parameter, which let’s your script read the relevant data out of your database and fill the meta elements with it.

Related

Twitter / Facebook Sharing in Emails

I have an email that get sent out to users, which needs to have a share to facebook or twitter button.
I know there are URL's which can open the share dialogs etc, but the problem is i need to track the number of shares for the item being shared (just a count).
I know there are things like the Twitter Count API, but it's unofficial, private and not supposed to be used, so i don't want to use that and then have it turned off and left with no data to work with.
The only thing i can think of, is have the email link to my website, which contains JS which opens up the Twitter/Facebook dialog, posts it then in the callback tracks the information back to my server.
Any other ideas?
You can set the link to an 'essentially' blank webpage, and use a typical Google Analytics tracking parameter on the link to record the count. Then, create an auto redirect form on the 'blank' webpage so when people click the link, it goes to the page, which then automatically redirects to the share link.
It's a roundabout way of achieving what you want but is one way..

Creating user owned objects generating implicit "post" action in timeline

I've been trying to use Facebook's new "user owned" objects as a way to track progression/scores in a mobile Unity game, for the user and their friends. So for each "level" completed I create a new myapp:level object.
Whenever an object is created like this, though, it shows up in the user's activity log as "User posted Object Title". I mostly just want to use these objects as data storage, and as a way to for the app to query and display your friends' data. I only really want to post a custom action (e.g., myapp:complete) if the user explicitly chooses to share it from within the app.
Not only does it generate these posts, it also create a new custom object type in my app's type definitions, simply called "Object", and an action type called "Post" (which seems to actually be og.posts). I even have to submit this auto-generated Post action for review, which seems odd.
Can I somehow disable the post action or is it an intrinsic part of creating user owned objects? If I can't disable it, is there any way I can hide it from the user? I can't set no_feed_story on the action as the action is implicit from the object creation.
(Note, I'm not using the Facebook 3.5 SDK on iOS, but using the Prime31 Facebook plugin for Unity, on Android, but really I'm just sending graph requests as specified on the Object API page.)
I don't think it is the intention of Facebook user owned objects to act as a data store?
Anyway, the way the graph works is that all things you publish is an actually an action. Even when posting objects. What is published on the users timeline, is the action of posting this new data item to the social or open graph.
Bottom line: you cannot get rid of this posted thing, as it kind of defies the purpose of Facebook being open and social.

Maintaining continuity of a Facebook post from website to Facebook

I am building a social application, users post data to the website, which is saved in our database.
This creates a record on the site, which is searchable and creates the basic content and function of the site (the purpose is not relevant at this point)
When a record is saved to our database, I want to "spread the word" and send this data out to social networks. Currently, I'm looking at Facebook in isolation.
So, I know how to create a post through the Graph API and post this content to the users Timeline, or indeed to a business page associated with the APP/Website.. but I am not sure how, or if indeed one should, maintain continuity.
What I mean... if a user creates a record on my website, and then the website/App creates a post on my business page, and also asks the user to post it in their Timeline, how do I stop this being two separate posts, and instead one post which has been shared?
I want to achieve:
User posts on website
>
Website posts to Page
>
Post on Page is "Shared" to users Timeline
As opposed to:
User posts on website
>
Website posts to Page
>
Website posts an additional post to users Timeline
The reason I want to do this, is that on the website, I want to be able to show shares, likes and comments from Facebook by tracking the ID of the initial post created when first entered onto my website.
Or am I trying to reinvent the wheel and should just use Facebook's comment plugin?
When you create the post on facebook on the Page, store the returned post ID in your data model.
From what I can tell, there is no way to access the normal user share directly through the API. If you insist on doing it programmatically without popping up any dialog for your user, you can make a post to the user's page which has (the start of) the Page post and a linkback to the Page post as an attachment. This is probably to prevent abuse.
However, if you don't mind relying on an undocumented and deprecated endpoint, you can use the old sharer.php endpoint, so long as you have a fully qualified link to the post you want to share (you can retrieve the url through the api). This will also require your user to enter anything appropriate in their share and then click "share."
The endpoint is
http://www.facebook.com/sharer.php
Call it with the u parameter filled in with the url, so
http://www.facebook.com/sharer.php?u=[URL encoded URL of the post you wanted to call]
You can try this with any facebook post (go to a post, copy the url, past in as the parameter), it's still working (I just tried it) but there are no guarantees. See the top answer to Facebook API: "Share" a post already posted on a page's wall?.
You can still access likes, comments, etc for that post id through the Graph API (and you can provide your users a direct link to the post). Cache/update them as recommended and display them on your own page. You are basically mirroring back onto your own site what is happening on facebook in regards to the post you made.
I would go this route especially if you are at all planning on branching into other services. That way you can do an aggregated display of statistics/likes/etc from the multiple services you are having your platform repost to. This is also good for (at least an impression of) data integrity for your users: they know that your service represents everything they have done in case anything happens to their facebook/etc accounts.
This could especially be noteworthy if they are worried about facebook/etc deleting any of their posts, or for recovering from any issues where a post/comment/etc is not properly stored by facebook/etc (for example, comments have a maximum length which, at least via the main FB UI, silently drops anything above the maximum length in a non recoverable way for the user).

Can OrderedFriendsListInitialData Be Accesed Via API

Hi I'm a web developer and a client has asked me if I can build an app that displays the information contained inside the OrderedFriendsListInitialData. This information is found when you view the source code on your Facebook news feed.
The Facebook Terms of Service is very clear about NOT scraping Facebook pages, so I would need to access the data via the API. The idea is to allow users to see this list in a convenient way though a Facebook app.
Also, if this is NOT possible, then would Facebook make an exception to scraping this singular element for the sole purpose of displaying it to the user it was generated for.
I.e. not showing it to other people, only scraping the data to show it directly to the user without saving it to any database.
There is no API available to return the coefficient-ranked friends list - if your app needs to organise friends based on the user's relationship to the friends, a popular method to do this is to examine the user's photo tags and/or news feed and likes to choose friends most closely associated with the user

Wall content on my website

What I want is to be able to put the wall content of my facebook page in my website. I want to include the posts and comments of others and mines.
I have 2 questions:
Activity feed:
Here is what the FB docs say :
<fb:activity
site="jerrycain.com"
action="critiqueapp:despise,critiqueapp:review,critiqueapp:grade">
</fb:activity>
Where can I get a list of all possible actions? Can I specify that I want posts and comments?
OpenGraph:
I was able to get an access token yesterday, that is not valid anymore. I was able to see a json object of the wall content. What is the best way to have this permanently?
Activity feed social plugin is using OpenGraph actions in action field so the complete list is simply not available due to possibility to create custom actions for every application, there is several Built-in Action Types:
Watch - Video, Movie, TV Show, or TV Episode
Read - Article
Currently specifying like also works but it's not documented. Aside of those pre-defined actions you may Define Actions. Neither posts or comments is listed as supported actions in documentation.
Access tokens are expired and need to be extended if you need longer life-time of a token. Also you may use application access_token to access public posts from your page (without need to get the token from user)...