Facebook API - how to retrieve "is_verified" pages? - facebook-graph-api

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.

Related

Facebook PHP SDK : Post a Check in without a PAGE_ID

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.

Facebook Open Graph API - action-type & object-type of another application (foursquare)

I am trying to retrieve a user's foursquare checkin data that is published using the open graph to Facebook. I am generally having trouble finding information (namespace, action-types and object-types) about an application that I do not own.
So far my application has successfully asked the user for (what I believe are) the appropriate permissions to access data that they have submitted to the foursquare FB application:
user_actions:playfoursquare
I found 'playfoursquare' from the url when I visit a foursquare application page in the new timeline:
http://www.facebook.com/[my_username]/app_playfoursquare
Now I am trying to query the Graph Api using a url with the following structure: (ref: http://developers.facebook.com/docs/opengraph/objects/#retrieve)
GET /me/{namespace}:{action-type}/{object-type}
Now, in the meta data of a foursquare venue page I found a og:type of 'playfoursquare:venue'.
So far I have what I suspect are the namespace and object-type. I'm just short and action-type.
From a user's foursquare application page on Facebook (http://www.facebook.com/[my_username]/app_playfoursquare) there is a lot of references to 'check-ins' so I have made an assumption about the action-type and concluded that the graph api request should be:
me/playfoursquare:{checkins,check-ins,check_ins}/venue
I tried all above variations of 'check in' and they all return:
OAuthException - Unknown path component - 2500
I can't believe that this detective work is the best way to determine the properties of another application on the Open Graph. I guess I am missing something obvious.
Either way I would appreciate any help anyone can offer here. I'm at a bit of a loss.
Thanks,
Gfte
Yes, currently, while its easy to find the namespace of another application (inspect some html, look at URLs) - its not possible to find the action names used by another app - you have to guess.
But for Foursquare, after doing some trial and error myself, I've been able to determine that their current actions are GET-able at the following URLs:
https://graph.facebook.com/me/playfoursquare:checkin_to?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:became_the_mayor_of?access_token=TOKEN
https://graph.facebook.com/me/playfoursquare:unlock?access_token=TOKEN
once you have the user_actions:playfoursquare and/or friends_actions:playfoursquare permissions.

How To Get Historical "Facebook Page Likes" Data via Graph API or FQL

Was wondering if anyone knows how to get the historical data for any Facebook Page.
For example, number of fans for RedBull fan page on a given day in the past or for a given period that ends today so that I can show fan development of any page over a given period.
I tried it with the graph API and FQL (insights) but no luck.
https://graph.facebook.com/{USERNAME}/insights?fields=likes&period('week')&end_time_date('2011-06-26') --> empty result
Pulling the data via FQL also returns no results, plus it seems without a read_insights permission nothing is possible for page data
I'd need this to be available with only a generic user access token. This data is publicly available anyway. Result should be somewhat like this: http://www.socialbakers.com/facebook-pages/australia/
https://graph.facebook.com/{{pagename}}/insights/page_views?access_token={{access_token_key}}&since=1420070400&until=1421625600
Since & until parameter in the above code takes in unix time.
add necessary information in the {{ }} and this code should work.
Without insight permission I recommend that you write something to perform a nightly query on the page graph and record the stats you need. If the page is public most of the information shown on that site is available.
You could also scrape info from http://pagedata.appdata.com if the page has already been listed...

FQL Javascript Bug Workaround: Search for id from name

Is there a workaround for the current bug in FQL: http://developers.facebook.com/bugs/266794040030851?browse=search_4f2ff35cf1e521b94883666
The idea would be to request SELECT id FROM user WHERE name="First last" but there is currently a bug in the index such that you can't search by name.
I need to find someones facebook id from their full-name, preferably ordered by mutual friends. I've tried the facebook search api but haven't found it reliable.
Thanks!
Actually there is an ugly workaround but you have to go outside FQL:
https://graph.facebook.com/search?fields=id,name,link&q=|name|&type=user&access_token=MY_VALID_ACCESS_TOKEN
Using search API this might work, where there is |name| you should just put "Name Surname".
EDIT:
Beware: A facebook app cannot have MORE privileges than a facebook user, ok I'm expanding what I'm trying to say: As you know a facebook user can modify his account settings in order to be NOT visible in public search that means EVERY search will not display that particular user... if the user you are trying to search has this particular setting, then you won't see him, not even through FQL!
This is where a facebook user can set this

Does Facebook support Hash Bang #! Ajax Crawlable Urls?

Does Facebook support Google's ajax crawling specification and, if so, what do you need to do to implement it?
I am trying to get the Facebook "Like" button to work with AJAX crawlable urls as defined here: code.google.com/web/ajaxcrawling/docs/specification.html
I have this url which I can go to directly and it loads. Note the "#!" in the url:
http://www.idkshouldi.com/?#!idkDetails_idkKey=agppZGtzaG91bGRpcmMLEiljb21faWRrc2hvdWxkaV93ZWJfc2VydmVyX2dhZV9vYmpfSWRrVXNlciIDamltDAsSKWNvbV9pZGtzaG91bGRpX3dlYl9zZXJ2ZXJfZ2FlX29ial9JZGtJdGVtGN6kBgw
When I "Like" this page it should crawl this "escaped fragment" url:
http://www.idkshouldi.com/?_escaped_fragment_=idkDetails_idkKey=agppZGtzaG91bGRpcmMLEiljb21faWRrc2hvdWxkaV93ZWJfc2VydmVyX2dhZV9vYmpfSWRrVXNlciIDamltDAsSKWNvbV9pZGtzaG91bGRpX3dlYl9zZXJ2ZXJfZ2FlX29ial9JZGtJdGVtGN6kBgw
Why won't it crawl this page? The Facebook linter is not properly crawling my page. If one uses the Facebook linter tool here: developers.facebook.com/tools/debug
It won't properly crawl an AJAX enabled URL with the "#!" in it. This is Google's specification. What Facebook's lint crawler needs to do is to replace the "#!" with "_escaped_fragment_". It doesn't appear to do that with my AJAX enabled links.
This is also a big problem for me, but unfortunately it appears Facebook does not support this Google URL notation. Facebook's crawler/parser does not translate from hash bang (#!) to an _escaped_fragment_ format URL.
Like you I have tested my page on Facebook's URL linter and it only picks up static Open Graph tags within the dynamic original page, rather than the page-specific Open Graph tags in the _escaped_fragment_ server-side variant of my page. Unfortunately, this means that Facebook sees my Open Graph tags as site-specific, rather than page specific.
It is rather an irony that this appears to be unsupported as Facebook uses this approach itself to allow Google's crawlers to pick up Facebook pages.
One potential workaround, that may help you a little bit, is:
1) Use your _escaped_fragment_ page version in Facebook links
2) Add an automatic redirect to your _escaped_fragment_ variant to the proper version.
This should mean that Facebook will pick up the proper meta tags, and the user will click the link and end up on the correct page. The downside of this approach is that the user has to know the rather ugly _escaped_fragment_ URL. In other words, it will probably only be you that knows it, unless you add some sort of 'generate shareable link' button to your page.
It is surely only a matter of time before Facebook adds support for this as single-page hash bang sites are only going to become more prevalent.