Get restaurant menu from Page using Facebook Graph API - facebook

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

Related

Open graph stories with user generated content possible?

Reading through the FB documentation I'm not sure how to approach this or if it is even possible with open graph.
I'm looking to create a story for a iOS app that will post an image taken by the user, along with title and description written by the user. This will deep link back into the app. Looking at the open graph documentation it looks like that is meant only for known and public accessible content. For example books read, movies watched, achievements earned for games etc.
Can I create user driven posts with open graph, or is it really the Graph API I should be looking at?
Main goal is too keep the content private and only viewable to those users the content has been shared with. Seems any open graph solution would make posts accessible by visiting a og: page with the right variables, no auth needed.
I don't totally understand everything you are asking (and I'm pretty new to all of this too) but here's a link on how to have a user post an image and message. You do need an auth though.
https://developers.facebook.com/docs/opengraph/howtos/adding-photos-to-stories/

Post via open graph to Company Page NOT user

As I am learning and getting familiar with the FB OG API I am finding that I am lacking some of the basics. For example I see here that I use the action type news.publishes to post an article. However the access_token is for the user owning the page and thus it will go to their news feed and not the page (in this case their company page). Correct?
If I understand correctly then how does one get it to post to a specific page. Is there an access_token collection you iterate through till you find the one for the company page?
TIA
JB
You should be able to use /PAGE_ID/feed? Where page id is the numerical assigned by facebook..or the text friendly name you used.

"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.

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.

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.