I wanted my application to post a status on users wall which should be seen only by the persons in that locale? How is it possible to restrict it in facebook apis?
The documentation for a Post has a detailed list of all fields, one of them is the "privacy" which controls who will see the post, it says:
object containing the value field and optional friends, networks,
allow, deny and description fields. .... The description field may
contain a comma-separated lists of valid country, city and language if
a Page's post targeting by location/language is specified.
I recommend that you go and check it out since it has much more text written on this field.
Related
I need to have something like http://fanpagelist.com/category/musicians/ in my web app.
Basically I need to allow users to search through Facebook pages of musician/band category and sort by number of fans.
The closest I got was with this FB Graph API call:
search?q=musician&type=page&limit=25&after=MjQZD&fields=name,fan_count,category
But that is searching for pages that have 'musician' in the name, not in the category field.
Any idea? It must be possible since fanpagelist can do it...
There is no way to filter the results from that search endpoint directly.
You are limited to the options described under https://developers.facebook.com/docs/graph-api/using-graph-api/#search, and that basically means you can search by name, but nothing else.
So you will need to filter the results on your end.
I am new to facebook graph. I manage to access all the posts using:
https://graph.facebook.com/THEPAGE/posts?access_token=MYTOKEN
But this list all posts. How to get visible posts only? Or how to determine if post is hidden on the page?
Thanks!
As long as you've requested the read_stream permission, every post object will include a privacy field which specifies who can view that post. You can filter the posts on the client based on this field.
You're probably only interested in the value field of the privacy specification, which is one of EVERYONE, ALL_FRIENDS, FRIENDS_OF_FRIENDS, CUSTOM, or SELF. For example, posts which are visible to everyone will have {"value":"EVERYONE"} in the privacy field.
There is a parameter include_hidden that you can send on each request:
https://graph.facebook.com/THEPAGE/posts?include_hidden=false&access_token=MYTOKEN
How can I get all post on Facebook up to some date that contain a specific keyword, just like for twitter https://dev.twitter.com/docs/api/1/get/search.
Facebook keyword insight API https://developers.facebook.com/docs/keyword_insights/ allows to do analysis of the keyword on posts for last 12 days but it does not return the actual post that contain the keyword. How can I get post or comments?
You need to use the Facebook search API.
It should be noted though that this method will only return publicly posted status/post. You can't search private status (for obvious privacy reasons).
Is it possible to localize objects in Facebook's OpenGraph?
My specific goal is having French/English users able to like the same URL or Graph object, while having local-specific descriptions appear in their timelines. So far the only way I can achieve this is having two separate graph nodes, effectively dividing the number of likes in half.
I've attempted to provide English and French versions of my page, with the French version using the English page's URL as its canonical URL, but this results in the French user's having the English page's title/description appear in their timeline.
Is there any way of having both French and English versions of the page while having one shared "like" count?
The detailed docs you want are here:
https://developers.facebook.com/docs/beta/opengraph/internationalization/
In short, you'll want to provide a primary locale in the og:locale tag, and then alternate locales in the og:locale:alternate tag. For each alternate locale, the FB scraper will rescrape the page, but pass in the alternate locale in the fb_locale query string parameter. You should take this query string parameter and provide the appropriate locale-specific meta data.
I'm looking for clarification on how Facebook uniquely identifies objects in the object graph. Specifically, we have several hundred sites for which there is significant overlap in pages that display hotel information. We'd like to have 'Like' buttons for hotels, but have the counts aggregate across sites - so that it doesn't matter on which site a person 'likes' a specific hotel, it'll contribute to the same global count.
More importantly, the philosophy behind Open Graph is that is represents associations between real-world objects - which just happen to be represented by a web-page, so it makes sense for page about a particular hotel to reference the same hotel page object in the graph, regardless of which site it was 'liked' from. For example, for books and products the Open Graph Protocol (OGP) uses ISBN and UPC numbers, while no such universal code exists for other types.
Specifically,
If I set the Open Graph Protocol (OSP) og:url meta property of a hotel page to a URL that references a central site - so that it will be the same og:url for all pages about that hotel regardless of which of our many sites the information appears on, will that achieve the uniqueness required? (does FB even interpret that or is it considered opaque?)
When I use the FB Debugger/Lint app to check my page, it complains that the App ID referenced in the fb:app_id meta tag isn't allowed on any domain other that the 'base' domain set in the App's settings on Facebook. Assuming that this implies I need to create a separate app for every domain we use(!), is there any implication of that for the hotel object identity? (or will the hotel identity remain independent and 'Like'ing a hotel via a Graph API call with any App ID will result in the correct association with the single hotel object as identified in its og:url?). Do I even need an App ID on the page? (just admins perhaps?)
If Facebook returns any of the hotels when people search on the Facebook site, which URL/link will it offer for the result? (the og:url?)
Lastly, and slightly OT, I'm wondering what happens if the og: metadata for a particular canonical og:url object has different properties on different sites, what Facebook will make of it (- e.g. if the og:site_name was different on each domain where the same hotel was represented by the same og:url)
I'm still trying to get my head around it all, so I appreciate all those Facebook ninjas out there :) Apologies if I've put too much detail.
Cheers.
To partially answer 1, Facebook says "If a user likes your URL using a Like button, a News Feed story [...] will be published to Facebook. The og:title links to og:url and the og:site_name is rendered pointing to your site's domain automatically."
Sad. While the og:url is intended to uniquely identify a real-world object, Facebook apparently thinks all users would like to have a link to only a single web-page about the object, regardless of the existence of many and from which page about the object they hit 'Like'. So, even if a user 'Likes' a hotel from a page like coolhotelinfo.con/abchotel or discounthotels.con/abchotel they'll get a link on their feed to boringhotelreferencedata.con/abchotel (for example).