I am new to use Facebook API in an android app. I m trying to access all public images from facebook using facebook API where user can get all pictures with given location from facebook.
How is it possible?
What you want to achieve is not possible, there is only another possibility, a workaround:
Get Facebook Places by location - it seems to work even without specifying the "q" parameter for a name: https://developers.facebook.com/docs/graph-api/using-graph-api#search
Get photos for those Facebook Places: /place-id/photos
More information: https://developers.facebook.com/docs/graph-api/reference/
Related
I made a website where people can post links for other websites and then the backend generates a preview of the link (by using curl and parsing out the open graph tags available on most websites / by picking the first image, html title etc). Now, fine after some tweaking but sometimes I get some kind of rate limit.
Here is one example of a link I want to parse: https://www.facebook.com/HBR/posts/10157131816732787
I can parse it 4 ou 5 times and get a title, image etc but then if I repeat it I get sent to the login page of facebook. How can I avoid this?
I tried to parse the link at https://developers.facebook.com/tools/debug/sharing however it says "Facebook URLs cannot be crawled". So my question is: how am I even supposed to parse those links if they don't even allow it on their debugger?
Is there any kind of API that allows me to get this information without user login? I don't want to parse entire facebook pages, profiles etc, just get a preview for a link that my users might post on the website.
You MUST use the Facebook Graph API if you want to get data of Facebook Pages (or anything else on Facebook), scraping is not allowed.
In order to get data of Pages you do not own, you need to apply for Page Public Content Access: https://developers.facebook.com/docs/apps/review/feature/#reference-PAGES_ACCESS
An App Access Token (without Login) is sufficient in that case.
API Reference for Pages: https://developers.facebook.com/docs/graph-api/reference/page/
I dont think show.You can crawl post on public group using python selenium and beautiful soup
farmville/frontierville/etc
How do I figure out how many "likes" these apps have?
The graph API does not work with apps.
The graph api below will show all the information related to the app
https://graph.facebook.com/159616034235/
result:
Call
https://graph.facebook.com/APP_ID
Try this example call in Graph Explorer:
https://graph.facebook.com/farmville
which will return a JSON reponse with id, name, picture, link and then likes as 5th value.
You can get the number of likes from Graph API by querying by Application id or Application namespace.
https://graph.facebook.com/APP_ID_OR_NAMESPACE
You can also limit results to be only constructed from id of an application and likes by using fields argument in URL:
https://graph.facebook.com/APP_ID_OR_NAMESPACE?fields=likes
Beware that not every application have a namespace defined and because name of application is not unique, it's better to use id of application to retrieve details from Graph API
You are wrong. The graph API does not work with apps.
http://www.facebook.com/dominodraw/
takes me to 'page not found'. So, dominodraw is not a valid facebook username.
Try graph.facebook.com/<your_app_id> and it will get likes for your app.
p.s. Just in case you are confused.
farmville is not only the name of app, but also they have registered farmville as facebook username.
So, they can do https://graph.facebook.com/farmville along with graph.facebook/208633805894647
If you havent set username for your app, you can only call graph api by app_id.
I am using php sdk fql and graph api both for counting facebook likes. When I pass url like http://mydemowebsite.com/city/id-12345.html it gives me correct count but when I pass url like
http://m.mydemowebsite.com/city/id-12345.html to both the apis, its giving me different like count, Although it is the same page. It also shows same count on browser for both the links.
Like Counts unique identifier is the URL, you maybe able to get around this but going to Facebook App Edit Settings and under website set the site domain to mydemowebsite.com. this allows for any subdomains of mydemowebsite.com to use the facebook api.
I would like to get the profile picture. Can I do that with the Facebook SDK, and how?
When I use the Api.get option I get a jsonreader exception.
You can render the photo by just doing:
<img src="https://graph.facebook.com/**id**/picture"/>
in your page (obviously changing the id to the id of the user).
You don't have to retrieve it using the API, but you do have to retrieve the id.
You can also get pictures by their id using /photoid like so /98423808305
You can find more information here - http://developers.facebook.com/docs/graph-api
I want to get the posts (only from the band, not others) from a Facebook Page Wall (its a Band, so no private profile) and publish it on MY own site.
I hoped to get the Posts as XML or JSON and then parse them.
So I wanted to use Facebook as a news System.
But I didn't find a solution - I don't want to have the user to log in with his account to see anything - it should be just a public stream.
The only idea I found was to use twitter as an export mechanism, but that's kind of elaborate.
Does anybody have an idea?
You could use the Facebook php sdk: https://github.com/facebook/facebook-php-sdk
It ends up looking like this:
//
include('facebook.php');
$fb_config = array(
'appId' => $yourAppId,
'secret' => $yourSecret,
);
$facebook = new Facebook($fb_config);
$feed = $facebook->api("/{$nameOfFaceBookPage}/feed");
That will give you an array of feed stories.
I assume you created a facebook page for your band and it has url in such format:
http://www.facebook.com/pages/<band_name>/<page_id>
In this case you can read wall posts in json format using Graph API (no login required):
https://graph.facebook.com/<page_id>/feed
If you only want posts from "me", can't you just use the Like Box social plugin and show the stream? This plugin will only show posts from the page owner.
http://developers.facebook.com/docs/reference/plugins/like-box
I am developing a similar app and after a lot of searching finally accomplished
https://graph.facebook.com/194466683916784/feed?access_token=AAACTzPZAxblQBAHND7fo1rA58VqQawuJb806Q6BeIFhTroyGSYIe5i0R5fZAZBtffNvkkZB7ayvV7Vw7j7ZBf7vGt6xHx2gjx4FhO8d27sAZDZD
enter your page wall id after .com and in the access token get your own access token from Graph - API explorer
Then exchange that token for a longer for a longer lived one that is for 60 days and you are good to go
Some time ago I had your same problem and I was looking for something very simple to publish feeds of facebook pages, but I didn’t find any solution on the web.
What I want to achieve are the post (only from my personal fan page, not the other) of the bulletin board (facebook wall) of a FB page (this is a fan page, not private profiles) and publish it on my site.
I was hoping to get the posts in JSON or XML format and then encode them so as to use FB as a news system. Unfortunately I haven’t found any kind of solution because I don’t want the user has to log in his account to see something so it must be a flow of pubblic feed.
So, I decided to code the plugin. Here the link to the tutorial:
http://www.lorenzodedonato.com/freebies/facebook-plugin-per-visualizzare-i-post-della-bacheca-di-una-pagina-fan-creato-in-php-json/