Facebook PHP SDK : Post a Check in without a PAGE_ID - facebook-graph-api

I would like to know If it's possible to add a Check in on Facebook with PHP but without any Page id.
Because I have a database with a lot of places but I do not have a corresponding Facebook Page Id.
ANy idea?

To my knowledge, it is not possible to do a Check In without a page_id.
You can refer to How to get place_id before checkin? to find out how to get Facebook Page Id for your places.

Related

How to get post information

How I can get informations from post ID of any page?
I try to get it with php sdk graph but I fuiled every times.
that what I want :
Just put ID of post from any page to get informations (page, img, quote, created date, ... ).
thanks.
Your Facebook app needs the Page Public Content Access Feature. Then your can fetch post information from any page, but depending on your use case it may be hard to get a positive review.

Facebook API - how to retrieve "is_verified" pages?

I'm using Java for searching public page info in Facebook.
I chose for now to use the Facebook4J but this is not a must.
I succeeded to search for pages named "Some Name" and I would like to read the is_verified property of the page to make sure this is the official page I'm looking for and not a faked one.
There is no isVerified() method on Page object and I do not how to run a FQL query using the search API.
This FQL runs well in Facebook simulator:
select page_id, name, is_verified, is_community_page
from page
where name='Tom Cruise' and is_verified=1
The Java code I'm having right now is this:
ResponseList<Page> pages = facebook.searchPages(personName);
I tried copy-paste the FQL into the search as parameter, as the method signature is
ResponseList<Page> searchPages(String query) throws FacebookException;
but I get no results...
I also cannot loop on all 'Tom Cruise' pages and ask whether they are verified or not because, as I mentioned before, there is no 'isVerified()' method on Page.
I'll appreciate any Java solution, even if it means that I should drop Facebook4J for another platform.
The is_verfied page field is added with RestFB version 1.10.0.

Use FB API to get the pages that a page likes?

I've been looking at the documentation for the FB API as it pertains to pages to see if I can get the pages that given page likes and all I can see is a field that lets you get the number of users who like a given page. But, I can't seem to find a field that returns an array containing the ids and names of pages that the page itself likes. This works fine in the API explorer when trying to get the likes of a users.
I just use GET
/me?fields=likes
But, for a page... it doesn't seem to work.
Any ideas?
Put page id, instead of me:
https://graph.facebook.com/PAGE_ID/likes
Example: https://developers.facebook.com/tools/explorer/?method=GET&path=6815841748%2Flikes
Cheers

Difficulty parsing string with Facebook one click sign on and ColdFusion

I am using using ColdFusion 9.0.1
I am building a site that will use Facebook connections extensively, so we need the Facebook one click sign on. Specifically, to vote on our site, visitors will just "log in with Facebook" and can do all sorts of cools things while we track what they do using their email address.
I am only slightly confused by the Facebook documentation. And with their recent security change, most of the tutorials and help files I find elsewhere are out of date. So....
I have the single click sign on form on my page. When I am logged out of Facebook, I can use the "log into Facebook" link on my site to log in to my site as well as Facebook. So, I know the form works and the cookie works too.
From what I understand, I am supposed to read the cookie that Facebook sets in the browser and then parse it to access the info I need. Here's the cookie for my site:
cookie.fbsr_252075631496861
When I CFDUMP this cookie, here's what I get:
P2Hlk0UVT2EXc8LiaH48vmL_gI7Y4mwkto0IoSUN9mI.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiIyLkFRQ0VLMC1ibzhqeVhJSzYuMzYwMC4xMzI0MzM5MjAwLjEtMTAwMDAwNTg3NDM1OTY1fFNrYkQ1NU9UWndFMTh3cGE4TUZLZkpLalZzdyIsImlzc3VlZF9hdCI6MTMyNDMzNTU2OCwidXNlcl9pZCI6IjEwMDAwMDU4NzQzNTk2NSJ9
I have found a few tutorials on how to parse this string, but nothing works. I don't really know if I am acessing the right cookie.
Now that the user is logged into my site via Facebook, I just need their FBID to access their info. I believe the FBID is buried in this cryptic string.
Can you provide any help?
Once you get parsed signed_request (stored in your cookie) you can use user_id (which is Facebook User Id) and oauth_token (aka access_token) to get needed info via Graph API or FQL.

Getting users who like a web page with Facebook graph API

I'm struggling with the Facebook API. What I want to do is to be able to look at a user's feed, see which web pages they clicked "Like" on, and then get the other users who like the same web page. I'm having two problems.
1) Whenever I get the feed of a user, all of the "Likes" are removed from the feed. Its very frustrating because its like Facebook will give me everything except for exactly what I'm looking for!
2) I can't seem to get a list of user IDs who like a certain URL. I've tried using FQL like this:
SELECT user_id FROM like WHERE object_id=114324145263104
As was suggested in another SO question, but that returned nothing on all of my attempts.
Does anyone know how to do this, or if its even possible? Thanks for your help!
There is a different query for getting the linkes of a url
SELECT url FROM url_like WHERE user_id = me()
In your case it is.
SELECT user_id FROM url_like WHERE url = "http://www.domain.com/"
I had the same problem. This is what i do
https://graph.facebook.com/URL
OR if you have multiple URLs click to
https://graph.facebook.com/?ids=URL1,URL2,URL3