I am trying to get the total photo count of a user.
I tried these
me?fields=photos.limit(200).fields(images)
this returns id,not photo count
me/albums?fields=photos
me/albums?fields=photos?fields=source,name,id
me/albums?fields=photos&fields=source,name,id
gives cover photo ,profile photo
me?fields=albums.fields(id,name,cover_photo,photos.fields
on Graph API explorer with required permissions but either they are giving unnecessary info or the API returns an error.
You need the count field for each album
me/albums?fields=count,name
Related
I've been searching the Graph API Explorer and documentation for a long time, but I really can't find anything.
I need a simple GET request like the me/subscribes just with page-id/subscribers or something like that. Does anyone know the get I must send to get a Count of subscribers of a page?
BTW I'm using Facebook SDK and I'm using this as GET:
var fb = new FacebookClient(useraccesstoken);
dynamic result = fb.Get("i want to get subscribers of a page id what to do??");
The /me/subscribers end-point was available to users' only, and has since been removed with Graph API 2.0, along with the user_subscriptions permission.
You can get a count of the subscribers / likes for a page as follows:
/{page-id}?fields=likes
This will return an a count for the total number of likes for a given {page-id}:
{
"likes": 123456,
"id": "{page-id}"
}
Trying to access the subscribers of a page is the same as trying to access all the users that have liked the page, which Facebook doesn't allow.
I am building an application where users will upload photos which will be stored in an album on their Facebook account. Currently, I am using the C# SDK to achieve this, and I managed to get the photo uploaded.
When I tried to query the photo using the following FQL in the Graph API explorer:
select object_id, like_info from photo where object_id=[my_object_id]
I get the following result:
{
"data": [
{
"object_id": "11111111111111111",
"like_info": {
"can_like": false,
"like_count": 0,
"user_likes": false
}
}
]
}
Uploading a photo by posting directly to the Graph API endpoint https://graph.facebook.com/me/photos?access_token=[my_access_token] and doing a FQL on the resulting ID gives the same result - the can_like has a value of false. On both occasions, the "Who can see posts this app makes for you on your Facebook timeline?" setting for the app was set to "Public".
If I view the photo page, I can see the photo but there are no "Like" or "Comment" buttons. Upon further investigation, I found that the "Like" and "Commment" buttons will only appear if I (or rather my access token's user) is a friend of the uploader. Is it possible to make the uploaded photo "Likeable"? My objective is to allow users who come to my app to be able to "Like" the individual photos without having to be a friend of the person who uploaded it. Can this be achieved or am I missing something? Thanks.
This is restriction of facebook, but i have found a workaround, when user have their subscriptions enabled here: https://www.facebook.com/about/subscribe anyone can like/comment their photos...
I created a site where I need to display the images from my facebook album to my personal website but when I call the GetPhotoAlbum().Count method then it returns a '0' count.
Any ideas why it says a zero count as I have 100's of public photos in my facebbok account?
Here is the code:
FriendList1.Friends = _fbService.GetFriends();
works fine and displays a list of all my friends list.
Response.Write(_fbService.GetPhotoAlbums().Count);
returns 0 and no photo/album is displayed
You need to get an access token with "user_photos" extended permission. You can test this with the new Facebook graph explorer.
i want to get album photos so far i have been able to get album info
I am using facebook c# sdk 5.0 for dot net framework 4
code so far is dynamic friends = app.Get("me/albums");
this provides data and we can get everything mentioned here http://developers.facebook.com/docs/reference/api/album/
but i cannot establish connection mentioned for photos
so far i have been able to find this method if there is a good or different approach then please let me know.
//Get the album data
dynamic albums = app.Get("me/albums");
foreach(dynamic albumInfo in albums.data)
{
//Get the Pictures inside the album this gives JASON objects list that has photo attributes
// described here http://developers.facebook.com/docs/reference/api/photo/
dynamic albumsPhotos = app.Get(albumInfo.id +"/photos");
}
Is it possible to get all photos by a persons name through the Picasa Web Albums Data API?
All examples I can find, shows how to get photos by an albumid.
You can request a list of the most recent photos, with a very high value for max-results.
I'm not sure if you are using the .NET API Client Library, but if so, an example is here:
http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_dotnet.html#ListRecentPhotos
Use query.NumberToRetrieve to set the value for max-results.
If you are not using the .NET Client Library, an example using HTTP protocol can be found here:
http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_protocol.html#ListRecentPhotos
You can retrieve facial recognition data from the Picasa Web API through a (currently) undocumented API URL that is used by the Picasa desktop application. More info here:
http://klick.com/pharma/blog/2011/09/retrieving-face-tag-data-from-the-picasa-web-api/
by setting "default" that mean retrieving current user with that code you can retrive the user photos in specific album
PhotoQuery query = new PhotoQuery(PicasaQuery.CreatePicasaUri("default", albumId));
PicasaFeed feed = picasaService.Query(query);
foreach (var entry in feed.Entries)
{
PhotoAccessor photoAccessor = new PhotoAccessor((PicasaEntry)entry);
Photo photo = new Photo();
photo.Title = photoAccessor.PhotoTitle;
photo.Summary = photoAccessor.PhotoSummary;
photo.MediaUri = entry.Content.AbsoluteUri;
photo.Id = photoAccessor.Id;
photo.AlbumId = photoAccessor.AlbumId;
photos.Add(photo);
}
If you know the subjectid then using an RSS link you can get a feed of ALL images for that user regardless of albums. The link is:
http://picasaweb.google.com/data/feed/base/user/PICASA_USERNAME?alt=rss&kind=photo&subjectids=SOME_BIG_LONG_STRING_OF_CHARACTERS
Also, you can find the subjectids by going to each person on PWA and clicking the RSS link at the bottom of the page.
I am stil trying to find a way to get all subjectids without a manual lookup.
Source: http://credentiality2.blogspot.com/2010/02/picasa-gdata-api-and-face-recognition.html