Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lefuturiste/google-photos-album-crawler
Get images of a public google photos album
https://github.com/lefuturiste/google-photos-album-crawler
Last synced: 4 days ago
JSON representation
Get images of a public google photos album
- Host: GitHub
- URL: https://github.com/lefuturiste/google-photos-album-crawler
- Owner: lefuturiste
- License: mit
- Created: 2019-08-24T12:44:52.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-15T21:21:02.000Z (over 1 year ago)
- Last Synced: 2024-10-28T22:22:51.463Z (19 days ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Google photos album crawler
Just a little and light script to fetch an album name, images from a public google photos album url. This simple script will simply use guzzle to get the html of the page, apply a regex to get the JSON data, then parse it. For big album it might take a little bit of time so be patient and make sure to not block the main thread of your application. You can for example use this script in a async task or a job queue.
Enjoy!## Requirements & dependencies
- php7.1 or newer
- ext-curl
- guzzlehttp/guzzle## Installation
`composer require lefuturiste/google-photos-album-crawler`
## Usage
Be sure to use a public google photos sharing URL with the correct format.
Use the Crawler class inside the right namespace and call the method `getAlbum` after instantiating the class.
This method return the following format:
- `id`: id of the album
- `name`: name of the album
- `images[]`:
- `id`: id of the image
- `url`: the base url to download the image
- `width`: the max width of the image
- `height`: the max height of the image```php
getAlbum($url);echo "Album: " . $album['id'] . " " . $album['name'] . "\n";
echo "Contain: " . count($album['images']) . " images \n\n";foreach ($album['images'] as $image) {
echo "- " . $image['id'] . " " . $image['width'] . "x" . $image['height'] . " " . $image['url'] . "\n";
}```
For a simple in a file example see: [example.php](https://github.com/lefuturiste/google-photos-album-crawler)
## Contributing
Any issues of suggetion, this is a open source project so you can use github Issues and PR.
Also feel free to contact me if you want a quick answer because I don't notice the github notifications...- Email: [[email protected]](mailto:[email protected])
- Mastodon: [[email protected]](https://mstdn.io/@lefuturiste)
- Discord: `lefuturiste#5297`