Facebook: posting a fitness.bikes OpenGraph action - facebook

I'm trying to submit a fitness.bikes story from a Windows Phone app. Ideally I'd like it to look the same way it does in the documentation -- a table of stats, and a course map. I'm trying to figure out how to make that happen. Specifically, whether it's possible to make it happen without a 3rd party server hosting the ride data.
Questions:
When I am submitting a course object to Facebook, can I specify all needed ActivityDataPoints to make the map show up, or is something else needed?
In the sample post I've been trying, all I get is the Title, the Image, and the Description. Can I get the table of stats to show up, without needing an external server?
The posts I'm sending are not appearing on the Timeline, even for a test user. They do appear in the Activity Log, and are marked with "Allowed on Timeline", not "Showing on Timeline." I'm using fb:explicitly_shared... shouldn't the post show up?

Ok, after further experimentation, I believe I can answer my own questions:
The fitness.bike activity post data should contain only fb:explicitly_shared, privacy, and course links, and nothing else. For some reason adding created_time makes the post appear in standard layout.
Same answer as above. Table of stats is part of the Map layout Facebook provides.
Same answer as above. Removing the created_time attribute magically makes the post appear correctly on the timeline.
P.S. As far as an external server -- it is necessary only if you want to redirect the user to your own page. Even then, the server can grab the object_id from the URL, grab an access token from Facebook using AppID and AppSecret, then lookup that object (course), extract data out of it, and show on the page.
Hope this helps someone else.

Related

How to post a status message to facebook with TO target using facebook4j?

I am using facebook4j to add fb page feed posting capabilities to an existing system. Initially I thought it would just be for posting to pages, which is done, but many pages don't allow posting. In such a case I need to fall back to targeting the individual in a status message. In facebook such a post shows up with heading like "{User's Name}‎ > {Target's Name}".
The problem I'm running into is that even though the facebook graph api has a "to" attribute for a message, I can not find a way to accomplish this with facebook4j. The postStatusMessage() method appears to only accept the id of the feed to post to and the PostUpdate class does not have a "to" property. I could of course be misunderstanding what the arguments represent or how this should be accomplished.
Any suggestions would be appreciated.

Final Checklist/Written Approval for Facebook Graph Use

i am using this endpoint
https://api.facebook.com/method/links.getStats?urls=
to collect the number of likes of specific urls. I want to display this information on a front end but do not want to make unnecessary API calls (there are over 25,000 posts). I would like to retrieve this information and store it so it can be retrieved from our database. On some pages, there will be over 10 of these accessible view a hover effect from a mouse. I would prefer to not have to load the page up with javascript targeted elements everywhere. It would be much easier to have the information stored and updated periodically. We will not be going over the impression limit or even coming close, but I would like to just make sure I'm not doing anything that will get me in trouble.
I would like permission to utilize this data to help increase pathways between our site and Facebook to allow people to share the page. I'm pretty sure we're doing everything correct but would just like to make sure and not step on anyone's toes.
I read through the checklist here
https://developers.facebook.com/docs/opengraph/submission-process/
however I don't know if what I'm doing would be considered an app....? Any advice would be appreciated.
Have a look at my answer here: How do I get the likes number from facebook for a given url?
You can also use FQL queries with IN lists to query multiple URLs at once. Please consider that a FQL statement can have a maximum length of 2048 characters.
select url, like_count from link_stat where url in ('URL1', 'URL2', ...)
The "cheklist" you linked is completely unneccessary, because you don't need to submit anything related to OpenGraph objects or actions. You can even use the functionality without using an Access Token, because the link_stat table is public (https://developers.facebook.com/docs/reference/fql/link_stat/)

"Top Posts" depending on facebook likes

I have an idea to create a "top posts" feature to my website, which creates the "top" list depending on how many likes and shares that a post have on facebook.
Users may see how many likes an post has received so far since they only have to ask for a single, defined url. However, the website itself has to be able to query all the links that are tied to itself (which have a predefined url template like website.com/[post-id]) to create the "top" list. Is it possible to do something similar (or achieve the same result in a different way)?
Any ideas on a real workflow about something like this will be appreciated!
this seems like a little but interesting project. I don't know if there is a feature that could get that directly in the way you want, but i did something similar.
First you have the Graph API, with that you can get the Posts of a user using feed, with that every post is telling you how many likes does it have which you can get with POST_ID/likes.
Then you'll have to check for changes in the post periodically comparing its created_time and updated_time.
This could seem very hard, because you have a lot of posts and you have to check them all for updates, but you can use batch_requests so you can check them all at once.
I have made a bookmarklet which shows top posts in the Facebook News Feed as well as Google+, Twitter and Instagram Profiles.
Just add a new bookmark in your bookmarks bar and replace its URL with the following code and save it, then go to the social network website and run it:
javascript:(function(){var s=document.createElement('script');s.src='https://niutech.github.io/topnewsfeed/topnewsfeed.min.js';document.body.appendChild(s);})()
The source code is available on GitHub.

Facebook app special gifts implementation?

Example: Bejeweled Blitz frequently runs events and promotions that, when clicked, take you to their app page. Once there, the app can see that the page was reached by following the promotional link and forks over the reward.
How is this done? What do I need to do to implement a similar feature? To my knowledge the parent URL is out of bounds due to the domains being different (Facebook vs. my app), so how is the message passed to the app?
Every app (Canvas, Page tab)
You can get data by passing an app_data parameter to any URL linking to a Facebook app. This parameter value will then be added to the signed_request.
As so, this url http://facebook.com/mypage/app_123?app_data=promotion12 will allow you to get promotion12 via the signed_request.
In PHP, this would give you something like this:
$signed_request = $facebook->getSignedRequest();
$app_data = $signed_request['app_data'];
Of course, you could pass any string by there; for example it could be a JSON string.
That's really the heart of getting data from outside to inside an app.
Hope this help you out!
Canvas app
In Canvas app however, it's much simpler, every query parameter will be passed to the app.
So, http://apps.facebook.com/myapp?somedata=hey can be get via:
$data = $_GET['somedata'];
Facebook will just append those parameter to the iframe URL.
Docs
https://developers.facebook.com/docs/reference/login/signed-request/ (was pretty hard to find, damn FB documentation)
This is done with the query parameters passed in the URL that users click on. A clear example is DoubleDownCasino sharing an URL for their users to click on. The link is:
http://apps.facebook.com/doubledowncasino/?pid=PNNTDP&target_url=pid%3APNNTDP
What DoubleDownCasino probably does is once their canvas app loads, they parse the URL for the query params and the pid and target_url parameters help determine what type of "reward" the user gets. Once they redeem it, clicking the same URL won't get the reward again because it can check if the user has already redeemed the offer with the given pid and target_url.
Your question:
Example: Bejeweled Blitz frequently runs events and promotions that, when clicked, take you to their app page. Once there, the app can see that the page was reached by following the promotional link and forks over the reward.
What I explained above is exactly how Bejweled Blitz does it in this post. If you follow through the bit.ly short URL, the URL is:
http://apps.facebook.com/bejeweledblitz/?zgift=0/eTtVUuhF5ipdJmO1jlDhr96MtKjp1NYflJrcOddB6iZDH1y96K%2Bml6gC0%2B5yVN
So answering your question, Bejeweled Blitz run promotions and rewards by appending query parameters, which in this case is zgift, which they can then parse in their app by getting the current URL the user is hitting.

wall posts and fb:multi-friend-selector

Firstly i know that the documentation provided by Facebook says that fb:multi-friend-selector can be used in pair with fb:request-form and that it could only sends inviations or requests.
I have more specific need and that is not only to make invitations/requests but also along with the previous to post something on selected friends walls.
I've tried everything but i cant take the id's selected from the fb:multi-friend-selector, so i'm unable to make this posts.
The doucmentation for fb:multi-friend-selector says: This interface includes a series of which are included for selected users in the form that gets submitted to your action URL.
Is it somehow possible to catch this id's?
I'm working on my app in C# .net.
I read in some of the previous posts that is treating problematics similar to mine that is impossible to do this, but i found application that works perfectly in way that i want to make my application.
Thanks in advance,
Ivan
You can access the selected friend's id in the page that you are providing in "action" of fb:request-form.I am working with PHP so i am able to get those selected friend's id as $_REQUEST['ids'].So try some equivalent methods in c# for this.And if you get the friend's id you can publish to their wall.