How to get the facebook user id that likes my website (not a facebook site) - facebook

I am making a raffle within the people that had make an "I like" to a certain article of my external website (non facebook). In order to choose the winner I need to know who has made the I like.
This query:
https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url='myWEBSITE'&format=json
Only get me the total count of I Likes but not the users ID
This query is perfect:
https://api.facebook.com/method/fql.query?query=SELECT%20user_id%20FROM%20like%20WHERE%20object_id%3D%MY_object_ID&access_token=MY_ACCESS_TOKEN
But how do I get an OBJECTID for an external url??
Thanks in advance

Object can be any thing like video, note, link, photo, or album but can not be any FB page or Url.. So I guess its not possible to get the user Id for a URL.
If you are using JS SDK / Like plugin in your website to like it, i think you can subscribe to an event and then use some ajax calls to get those userIds whenever they instantly like it.
See Somnath Muluk's answer in https://stackoverflow.com/a/13467793/269521

Related

Howto select image from facebook

On my website there is possible post image from computer. But I would like also provide user to post image from facebook user album. I can imagine some dialog like "Facebook login" which will open faceook images and provide user to send image from facebook to my application. Does something like that possible? Many thanks
Yes, it is possible.
I assume you have a little experience with facebook api.
trigger login FB login window and request user_photos permission
make a query to facebook to get (all/random/a few) user albums like so me/albums?fields=id,count
If a key count is set, there are photos
(I would collect all IDs of albums containing photos and make a query to facebook with ech one ID)
Then again, query to facebook like so /%album-id%?fields=photos.fields(images)
Now you have an array of URLs of images which, for example you show to a user and after he selects, you download it and upload to your server
Since you did not request a solid code, I will provide you with at least with a little snippet, or show an illustration how to do that. http://paste2.org/hvGkngIL. (a metod index) (Might not work properly, since I cut it from a PHP framework I work with)

How do I generate Facebook like button with only the FB page ID

So I have a database table with the Facebook page ID's of my users. I would like to generate a like button dynamically with only the ID available to me to do this. The problem as I see it is that I don't know what the data-href attribute is supposed to have considering that Facebook page url's look like this: http://facebook.com/pages/hyphenated-name/<?=$FB_id?> and I don't have the hyphenated name stored in my database to generate the that url.
Is there another URL structure Facebook's back-end will accept that just has the ID and not the hyphenated name, but will still count likes on that person's Facebook fan page? Is this impossible?
You can do a look up of the id, and retrieve the link of the page stored.
example: https://developers.facebook.com/tools/explorer?method=GET&path=191825050853209
refer to: https://developers.facebook.com/docs/reference/api/page/ under link connection.
This method will require use of the graph api, or one of the sdks.
refer to: https://developers.facebook.com/docs/reference/api

Like an object on Facebook outside Facebook

I've been trying to use the Like button generator to get a Like button for some content on my fan page: http://www.facebook.com/photo.php?fbid=363385833679921&set=a.314588171893021.85085.305618229456682&type=1
What I want to do is show the likes this photo got on Facebook in the like button on my site and vice versa.
This seems to work for the actual fan page url but doesn't work for individual photos (haven't tested other objects).
You are able to see the likes the object on Facebook got through the graph API call: http://graph.facebook.com/363385833679921. So shouldn't that be available on non-Facebook sites as well?
Anyone know a solution to this without having to make a custom handler to show and post likes on site?
Why don't you just use the API to read the comments and likes on the object? Any user's access token will work if that user can see the 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.

Facebook: Get all "Likes" for a specific page

I am currently planning a facebook integration on our website. In the example given at the Getting Started page (http://developers.facebook.com/docs/opengraph), you can see that I like "The Rock" on Imdb. If I were Imdb, would it be possible to query the user object to get all likes on Imdb? For example would it be possible for them to build a page like "these are the films where you clicked the like button on our website"?
Thank you for your answer!
To get the likes for a page you need to do this:
use http://graph.facebook.com/
this will return a JSON object be default. Just snatch the likes property off it.
http://graph.facebook.com/wearex3 for example
But what you are asking requires you to request access to the user's data and from there get all the likes.
http://developers.facebook.com/docs/opengraph and http://developers.facebook.com/docs/guides/web are what you want to read.