Google Photos API - media items without albums - google-photos-api

I like Google Photos but I've noticed that it is lacking some basic metrics like how many media items are in my account. Also I wanted to see which of my media items are not included in any of my albums. I ended up creating a simple console app using Google Photos REST API. It uses GET /albums, then POST /mediaItems:search?albumId={id} to get each album's media items and then cross references them with a full list of media items returned by GET /mediaItems.
It worked reasonably well however I've noticed a problem with the shared items. For a shared album owned by account A, if a media item is added from another account B then its id won't be found in the list of the media items of the account A (which is not unreasonable). If such a shared media item is saved in account A its id won't match the id of the original shared media item added to the shared album (returned by POST /mediaItems:search?albumId={id}). W/out an indicator of some sort to identify if a media item belongs to another account it's challenging to filter them out. I expected to see the contributorInfo as part of the MediaItem but that attribute is not returned.
If I try to add a saved copy of the same shared item into an album using UI I get a notification message that it's already there so obviously Google Photos UI does have that info. Does anyone have any clever ideas on how to match a saved copy of a shared media item with the original? The code is available at https://github.com/pavelfomin/gphoto-manager

I ended up using ignore media items list in https://github.com/pavelfomin/gphoto-manager that I populate locally with the media items I want to ignore:
Usage: com.droidablebee.gphoto.GooglePhotoApplication [options] -token=<access token> [-Dsuppress-warnings] [-Dignore-media-items-file=<file with media items to ignore>]
--albums list all albums, sorted by name
--album-items list all items per album (use with care for large number of media items)
--items list all items (use with care for large number of media items)
--items-no-album list all items not included in any album
<access token> OAuth 2 Access Token can be obtained from https://developers.google.com/oauthplayground
use 'https://www.googleapis.com/auth/photoslibrary.readonly' as the requested scope
suppress-warnings suppress all warnings, including album media count / items mismatch
Ideally, I'd use Google Photos REST API to filter out the shared items but that does not seem to be possible at the moment.

Related

how to get destination info(bank and card details) on stripe

Let's say I'm getting payouts information https://stripe.com/docs/api/payouts/list
I want to get the destination info, so if we take the example from the docs:
I want the details from that destination, I don't mean the specific details like the exact credit card number, but the info when going on the page itself, this one:
It's not working listing the banks accounts https://stripe.com/docs/api/customer_bank_accounts/list , I'm getting zero results when list them all
I'm using Golang library but I think this solution can be solved by others programming languages
I'm also using expandable fields but I get blank results on bank_account and card details
what is interesting however, is when debugging the page, they make request to v1/payouts/{id} with expand[]: balance_transaction and the returned data contains the bank information, but when I do it with their API, that info is not returned back
The Payout destination is expandable, meaning you can have it replaced with the full object by sending you request with expand[]=destination or for a list command data.destination.

Can I GET a list of images not in an album without a bearer token?

I am writing a simple extension for phpBB. It will list thumbnails of images below the posting window to make insertion into the message easy. The user will setup their flickr nsid (with the help of a lookup function) and/or imgur username. When they create or reply to a thread a window is shown below the message window. They can select from any image host they have setup. A second drop-down will show the user's public albums. I would like to show all of the users 25 most recent images by default. If they want something more specific they can select an album from the list.
I can populate the album list and get a listing of the images in that album without using a bearer token. I would like to be able to do the same for all public images not in an album. It doesn't make sense that this would require additional authorization. Is this something that is possible? I would really like to stick to the un-authed methods.
Thanks.

Microsoft Graph API - How to upload attachments to a list item

This question has been asked before with not much success.
The documentation is totally unclear too. It implies that to create a new list item one would do the following. But doesn't give a specific example on attachments.
The listitem documentation has a sneaky caveat right at the end which says that files/document libraries are treated as driveitems:
For document libraries, the driveItem relationship exposes the listItem as a driveItem
Right, so does that mean that all files are then related to driveitems? It seems closer as the driveitem docs talk about the following example (indicating site-related content which is SharePoint)
PUT /sites/{site-id}/drive/items/{parent-id}:/{filename}:/content
But the above route doesn't specify a list-id either an item-id. So how does that fit in?
Which route do we hit to upload attachments on a list item? I have tried numerous requests:
PUT - https://graph.microsoft.com/v1.0/sites/root/lists/2696fba7-2cc5-482f-805e-a3dbf853e5e9/items/1/content
PUT - https://graph.microsoft.com/v1.0/sites/root/drive/items/1/createUploadSession (not list id though?)
To upload an small item (<4MB) into a Sharepoint Online document library or list which is not the default library, you can youse the following url syntax:
https://graph.microsoft.com/v1.0/sites/{SITE-ID}/drives/{DRIVE-ID}/root:/{FILENAME}:/content
{SITE-ID}: the id of sp site
{DRIVE-ID}: the id of drive (document library or list)
{FILENAME}: the name of the fie to upload
The "/root:" after the drive id is the important point.

flickr4java: can't retrieve list of people in photo

I have uploaded a test photoset in flicker (photoset) and the tagged a couple of users in each pic of the set.
Now I want to be able to retrieve the list of people in a given photo of that set, but the list always comes empty. This is my flickr4java code:
Flickr flickr;
PeopleInterface people=flickr.getPeopleInterface();
PersonTagList<PersonTag> persons= people.getList("17224159072");
for(PersonTag person:persons){
System.out.println("UsER:"+person.getUsername()) }
The debugger shows that the photo indeed contains people
hasPeople=True
and even the API explorer is able to retrieve the list but, as I said, persons is always empty. I have no trouble retrieving other information.
Any ideas?
Thanks

Flickr photos by group with location name

I am grabbing photos from my 2 flickr groups using the API method flickr.groups.pools.getPhotos. This is ok but i'd like to actually return the town name rather than just the geo location. Does anybody know of an alternative method to grab my images including the geo location, town name, and the group that they are in? I'd rather not make multiple API calls per image.
Thanks
So it appears there is no way of doing this. I had to call flickr.groups.pools.getPhotos then flickr.photos.geo.getLocation on each image to get its location. Not the best solution but it is then being cached into a db for improved performance, then only called once every 30 mins.
You can get location attributes by adding "geo" parameter to extras argument for flickr.groups.pools.getPhotos request.
extras (Optional)
A comma-delimited list of extra information to fetch for each returned record. Currently supported fields are: description, license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_q, url_m, url_n, url_z, url_c, url_l, url_o
In response you will receive geo latitude and longitude for each photo from group.

Resources