Skip to content

A tiny vanilla js library which consumes album's data from Google Photos service.

Notifications You must be signed in to change notification settings

pillowsoft/vanilla-gphoto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vanilla Google Photo

A simple vanilla js library which consumes album's data from Google Photos service.

Instalation

You can download the lib:

Include the vanilla-gphoto.js script into your html file:

<html>
  <head>
    <script src="vanilla-gphoto.js"></script>
  </head>
</html>

Running

To use this lib, just run the code below:

<script>
var data = {userId: "1", albumId: "2", max: 10};
VGPhoto.getAlbum(data, function(err, album) {
  // Do something using the err or album variables...
});
</script>

To find the userId and albumId, enter into your Google Photos album and take a look in the url pattern:

https://plus.google.com/photos/{userId}/albums/{albumId}

For example, this is my album url:

https://plus.google.com/photos/106082169903180828657/albums/5649990342671140529

The album variable will return an object with these properties:

{
  title: "album title",
  subtitle: "album subtitle",
  authors: ["first author", "second author"],
  photos: [
    {
      src: "http://domain.com/photo1.jpg",
      title: "photo title",
      type: "image/jpeg"
    },
    {
      src: "http://domain.com/photo2.jpg",
      title: "another photo title",
      type: "image/jpeg"
    }
  ]
}

Atention: Only public photos will be listed! Don't forgot to change the photo visibility to public.

TODOs

  • Bower support
  • Atmosphere support
  • Travis CI build
  • Jasmine test

Compatibility

  • Chrome 4.0+
  • Firefox 2.0+
  • Safari 4.0+
  • Opera 10.0+
  • Internet Explorer 8+

Changelog

1.0.0 - 11/25/2014

  • added getAlbum function
  • added AMD support
  • added Build task with Grunt

Author

Caio Ribeiro Pereira [email protected]
Licensed by MIT
This readme was generated by Readme Generator

About

A tiny vanilla js library which consumes album's data from Google Photos service.

Resources

Stars

Watchers

Forks

Packages

No packages published