Coder Social home page Coder Social logo

gapi-querier's Introduction

GAPI-Querier (aka find out-of-album photos)

I needed to get a list of all my photos (in Google Photos) that were NOT in an album, unfortunately Google didn't provide that feature. So I created this tool to get that listing via their API.

The gapi-querier tool itself is a shell that gets the Google user's auth and then runs the chosen script. The only existing scripts are those I wrote to find photos (in Google Photos) that are NOT in an album.

In order for the tool to access Google's APIs you will need to provide it with your (Google API credential's) "clientId". To get a "clientId" you will need to enable the appropriate API and create OAuth credentials (for JS) in Google Developer console. You will need to copy the "clientId" from your OAuth credentials and enter it into the gray box at the top of the tool's UI.

You can host it on your own computer (or wherever you want).. or you can use it here: https://jonagh.github.io/gapi-querier

  • I don't output very good errors (sorry), so make sure to check your credentials are correct.
  • Some errors can be viewed in the browser's dev-tools/console.
  • Note, unless you 'verify' your API project & domain, the Google signin popup will show a warning about the app not being verified, you'll need click 'Advanced' and 'Go to ... (unsafe)' to continue.

DISCLAIMER: This tool (as is) should be benign, it only reads your Google Photo index (id/url), it doesn't look at the images themselves, it doesn't send any data to any server (apart from the Google API requests themselves). There are no ads or tracking or anything (maybe Github or Google track hits/etc but that is out of my control). However I provide no guarantee or warranties or anything of the sort. You should use it at your own risk. You can view the source code and audit it or change it as you wish. The tool (as is) only requests permission for basic-profile data and read-only access to Google Photos, as already mentioned it does nothing with this data apart from outputing the desired results into the browser. Your Google API clientId, once entered, is stored in localStorage (in browser) for your convenience but can be cleared by you at any time.

Customizing

In theory other scripts can be written and plugged into the tool. See commands sub dir for examples, and commands.js is where they are imported into the tool/UI. If you create your own 'command' then I am expecting something like the following:

export default {
	name: 'Some display name that will show in the dropdown',
	scopes: 'SpaceSeparated GoogleAPI Scopes AkaPermissions',
	async run() { return 'Either an HTML string or a DocumentFragment which will be inserted into the DOM'; }
}

Your run() function will be executed when the user chooses your 'command' from the dropdown and clicks 'Run'.

Note: while coding this I was playing around (trying out Proxy objects, etc) so it is a bit fanciful in parts. I also haven't really gone through and tested or cleaned-up/improved/etc the code, sorry - and I don't plan to. You need a modern browser to run the code, but why would you run anything else.

gapi-querier's People

Contributors

jonagh avatar rjnienaber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.