Move a photo from one album to another - facebook-graph-api

I checked through the api's but I may have missed it, if it exists... I can't find a write/modify api call to change move a photo from one user album to another (such as can be done via FB's web interface by editing the album and use the pull down for each image to move them one by one.
Essentially I just want to modify for an image the enclosing album id. I don't want to download from one album and upload to another as I want all the tags and comments to remain intact (as well as the photo's id)....
My goal is to create a simple app to be able to move all (or a selection) of photos from one album to another, ie. "merge albums" since FB's web interface does not have that functionality. I have a ton of albums I created in 2009 when the limit was 60 photos per album so now that the limit is 200 I want to reduce my album count by over 67%...

There is no API to remove photos, so effectively all you can do via the API is copy, you'd then have to remove the extraneous albums manually using Facebook's web interface

Related

Google Photos API - Can I access existing enrichments?

I'm using the Google Photos Java API to create a small program to access the contents of a pre-existing album. I have been able to get code up and running that can report the album's name, and the media items it contains and so on, but not the text added between photos. I understand that the API considers these texts a form of enrichment and I can see there are functions for adding such enrichments to an album, but is there any way to list the enrichments already in an album? Or otherwise access the text a user has previous added between photos via the platform's desktop browser interface?
Unfortunately the Google Photos Library API does not provide a way to access existing album enrichments when accessing the contents of an album.
This has been filed as a feature request on the issue tracker for the API. You can 'star' it to draw attention to it and be notified of any updates: https://issuetracker.google.com/129050144

How to get direct permanent link to public image on Google Photos?

I have Google Photo public album and I want to receive direct links for photos form this album. This links I'll use on my blog web pages. How I can to do it?
P.S.: I know that Picasa Web Albums had this feature.
At this time Google actively changes its image service behavior. Now, there is not any algorithms how to receive direct and permanent links to your shared photos. The URLs are received by the right-button click, like https://lh3.googleusercontent.com/(LONGLONGCODE...)=w800-h600-no, are temporary and live one-two days and then will be closed.
You can try new Google service - Google Archive Album. This service was created as holder for albums from the deleted Picasa service. But it contains photos and albums from Google Photo too. The Google Archive Album have two greats advantages:
links are much shorter the from those of Google Photos,
this links are permanent!
For working with Google Archive Album you need to follow rules:
create standard (NOT PUBLIC) album in Google Photos.
go to Google Archive Album and make sure that you see the new album.
add to album required photos and only now change its type to the public by creating the shared link to it.
again go to Google Archive Album, open your album.
click on first photo.
right-clink on photo image and copy link to the clipboard.
insert received link where you need.
repeat steps 5-7 for others photos.
voilĂ !
But how long time Google Archive Album will working I don't know :(
P.S.: If you don't know - URL links from Google Photos and Google Archive Album can be tuned. For detail reads the special site.

Cannot fetch large type picture for multiple Facebook object ids Graph API

I just can't figure it out, i am using Facebook graph API to fetch data, lets say i have a multiple Facebook objects and i want their picture in type=large...
I saw some posts like this one
How do I mask Facebook graph api URLs for pictures?
That suggesting to do the following: /?ids=OBJECT_IDS&fields=picture&type=large
The thing is that it seems the once the picture is specified as a field like the above the type URL parameter doesn't seem to effect the retrieved picture.
If there is a way to fetch large type pictures of multiple Facebook objects in one request via the graph API please let me know...
Thanks
All you really need is the object's id.
If its a user then his/her user_id.
If its a page then the page_id.
etc...
Once you have that you can simply use this URL to get the large image -
https://graph.facebook.com/OBJECT_ID/picture?type=large
You don't really have to request the large image as you can place this URL directly as a link to the image. In HTML for example -
<img src="https://graph.facebook.com/4/picture?type=large" />
The problem with obtaining all the large images of different types of object is that they are all located at different endpoints. You would be able to get multiple pictures for the same type of object. For example -
by user_id
select pic_big from user where uid in(4,5,6)
by page_id
select pic_big from page where page_id in(1,2,3)
by event_id
select pic_big from event where eid in(1,2,3)
by group_id
select pic_big from group where gid in(1,2,3)

Share large photo from FB album

I'm creating a web app where I'd like to 1) upload a photo to an app-specific album on Facebook and then 2) share that photo as a LARGE item/image (not a thumbnail) on the users' Timeline. I know this is doable via User Generated Photo optional parameter but is there any other way to accomplish this for a web app?
There is nothing stopping web apps from publishing Open Graph actions with User Generated Photos. It's a simple process:
Setup Facebook auth on your site, your simplest option being to use the Javascript SDK with getLoginStatus. Make sure to request publish_actions permission from users.
Create an Open Graph action and your OG object types
When the user takes the appropriate action, make an API call of the following form (signed with the user access token and POST'd):
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_APP_ACTION?
YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&
image[0][url]=YOUR_PHOTO_URL&
image[0][user_generated]=true
Step 1 is the hardest part and you'd have to do that anyway if you weren't going down the Open Graph actions route.
As an example, Instagram use took as their action and a photo as their object. Their objects URLs are simply the individual photo pages on the Instagram website. So their API POST call would look like this:
https://graph.facebook.com/me/instagram:took?
photo=http://instagram.com/p/ABCD1234/&
image[0][url]=http://distilleryimage.instagram.com/somerandomstring.jpg&
image[0][user_generated]=true
As mentioned in the User Generated Photos documentation this will show up as a large, full-width photo on the users Timeline and feed.
The simplest way to perform all these API calls from a web app is to use the Javascript SDK and the FB.api function. You won't need to use any server-side code at all in that case!
Just fill this code on your photo caption
"took a ##[0:[124024574287414:1:photo]] with #[124024574287414:0]"
(without double quote symbol)
It clickable to instagram website, It's my own custom code, I made it for a week :(

Application permissions

I have enabled a user of my application to enable permissions to view photo albums.
However, what I really want is to not only enable the application to access the photo albums but to enable the user to select one image from the album that other users of the application can then see thereafter.
This is a competition application so the user selects an image and that image is included in the competition but users of the application must be able to view so as they can vote on it.
Must I take the image from the photo album and upload to a hosting server or is there away I can do this?
What you need to do is an application in your server which saves the photo the user has selected. Then you save the reference of this photo into a database and when other users comes to your application you request all of these in the database and show them back to the user.
This is a pretty basic programming structure, so Facebook serves you with a lot of shared data through many profiles. On the other hand, you are in charge of what you do with these data, how you use it and in which applications you implement it. Remember when you do this, you have to provide a privacy policy and a terms of use document to avoid any legal consequence to your end.