Can I Pull All Images on Facebook that I am tagged in with a particular person? - facebook

I am going to be using the Facebook SDK, however I was wondering if there was a way that I could use this SDK to pull a listing of all pictures I share with a certain person. For instance, if it is Friend X's birthday today, I would like to pull a list of all images that me and Friend X are tagged in together.
Any advice would be helpful!

you could perform the following request
GET me/photos?type=tagged&fields=id,tags
this will return all your tagged photos , and a json array of people who are tagged in it , you could parse the json response and iterate over the tagged people to determine whether the friend you specify is tagged or not .
Navigate in your browser to the following URL to get an idea of what I'm talking about
https://graph.facebook.com/me/photos?type=tagged&fields=id,tags&access_token={Your Access Token}

Related

Facebook Graph API: Get post/status attached photos

How can one get multiple attachments of a post/status in a group?
For example: A group status that some member wrote and added multiple photos to..
Currently I am using Graph api to get the group stream with group_id/feed and unable to see images attached to a single status - while accessing the feed from Facebook itself I can validate that there are few photos attached to the status.
Using FQL it is possible to get the attachments with the following query:
SELECT attachment FROM stream WHERE post_id = each_post_id
Considering I will have to send this request per post and that FQL will soon be gone I am searching for an alternative.
I was looking for a solution for this as well and actually just found it.
The Facebook Platform changelog says the following:
/v2.1/{post-id} will now return all photos attached to the post: In
previous versions of the API only the first photo was returned with a
post. This removes the need to use FQL to get all a post's photos.
With this knowledge I went to the Graph Api Explorer and found a post that had 2 attachments or more added to it.
After finding the post, and with that the post id, I tried the request Facebook told me to do:
/v2.1/{post_id}
This does NOT give you the desired result. The nice thing about the explorer is that you can search for fields you want to add to your request.
You want to add the attachments (plural) field. NOTE: It might be that the graph api explorer only shows the attachment (singular) field. This is NOT right.
So, to summarize:
Get the post id of the post containing the images.
Create a new request to the graph api that looks something like: /v2.1/{post_id}?fields=attachments
Then read the result to get your desired attachments.
I hope this helps you out as I have been struggling for a while as well.
KR
PS: This is tested with a user and not a group, but it should be basically the same.
PS2: This is just an explanation of how you get attachments of a single post. You can also add the attachments field to the /me/home egde to immediately get all attachments at every post like so:
me/home?fields=message,from,attachments
PS3: The permissions you need are
user_status
read_stream
user_photos
user_videos
Facebook is not very clear on this matter and it is very hard to figure things out like this. So I hope this will help everyone that is searching for this solution.
I answered for the same question here : /v2.1/{post-id} does not deliver photos
It seems it's a Facebook bug. My colleague opened an issue. Here's the link: https://developers.facebook.com/bugs/762280800482269/
You also can find some info here:
https://developers.facebook.com/bugs/790976317600139/
Hope it will help you.

"Top Posts" depending on facebook likes

I have an idea to create a "top posts" feature to my website, which creates the "top" list depending on how many likes and shares that a post have on facebook.
Users may see how many likes an post has received so far since they only have to ask for a single, defined url. However, the website itself has to be able to query all the links that are tied to itself (which have a predefined url template like website.com/[post-id]) to create the "top" list. Is it possible to do something similar (or achieve the same result in a different way)?
Any ideas on a real workflow about something like this will be appreciated!
this seems like a little but interesting project. I don't know if there is a feature that could get that directly in the way you want, but i did something similar.
First you have the Graph API, with that you can get the Posts of a user using feed, with that every post is telling you how many likes does it have which you can get with POST_ID/likes.
Then you'll have to check for changes in the post periodically comparing its created_time and updated_time.
This could seem very hard, because you have a lot of posts and you have to check them all for updates, but you can use batch_requests so you can check them all at once.
I have made a bookmarklet which shows top posts in the Facebook News Feed as well as Google+, Twitter and Instagram Profiles.
Just add a new bookmark in your bookmarks bar and replace its URL with the following code and save it, then go to the social network website and run it:
javascript:(function(){var s=document.createElement('script');s.src='https://niutech.github.io/topnewsfeed/topnewsfeed.min.js';document.body.appendChild(s);})()
The source code is available on GitHub.

Get facebook user checkins

I need to get a list of a facebook user checkins both in photos and in status.
I tried to use graph api to query /me/locations' like:
$this->api->api('/me/locations?limit=1000');
It returns me a list of user checkins with three different types: photo, checkin or status.
My problem is that I need to get the photos that have user checkins but I can't seem to find it.
Can anyone help?
Thanks
If you look at the User documentation, under the title feeds, it lists a method of fetching only the posts which have a location (Checkin) in it.
https://graph.facebook.com/me/feed?with=location
As for getting Photos with a location (Checkin), there doesn't seem to be any documentation that suggests that the Photos can be filtered similar to the way Posts can be filtered. At best, I guess you will have to fetch all photos and then filter out the ones that do not have the place tag. Posts use the location tag while Photos use the place tag.

How to get category specific likes for a facebook user using graph API

I'm pretty new at this. I was playing with the Facebook Graph API and was able to pull all my LIKES using the call
$all_likes = json_decode(file_get_contents('https://graph.facebook.com/me/likes?access_token='.[access_token]));
Now when I display these, they have a field called category which has different values like TV Show, Book, Public Figure etc.
So my question is how do I get category specific likes - for instance I just want to fetch ALL the BOOKS that I LIKE
Obviously its possible to fetch all the likes and store them on the server side and work on it but the LIKES list is too huge for certain users and it doesn't make sense to pull everything if you just want to show a certain category.
I feel like I'm missing something.
If its not possible through the graph API call, then even a FQL solution is welcome.
Thanks for your time
R
You can use FQL, just like in this answer:
SELECT page_id FROM page_fan WHERE uid=me() AND type="MOVIE"

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.