django-cms plugin to scrape a Google Photos public album link for photo urls.
Project description
djangocms-scrape-google-photos-album
djangocms-scrape-google-photos-album is a plugin for django CMS that allows you to include a public google photo album in your site by way of scraping their html.
WARNING: This is implementation is likely to break due to the nature of scraping. The regex will need to be updated whenever google changes the structure of that page.
Requirements
- python 3.5+
- django 1.11 (other versions may work, but this is the only one that has been tested)
- django-cms 3.5 (other versions may work, but this is the only one that has been tested)
Installation
pip install djangocms-scrape-google-photos-album
Usage
Note: Results are cached for 30 minutes. If this doesn't serve your needs, make an issue.
settings.py:
INSTALLED_APPS = (
...
'djangocms_scrape_google_photos_album',
....
)
Override the template included, as it's likely to not be the html that you want. Below is an example of how you could use it with Bootstrap 3 and featherlight.js.
/my_project/templates/djangocms_scrape_google_photos_album/album.html
{% if photo_urls %}
<div class="container-fluid">
<div class="row" data-featherlight-gallery data-featherlight-filter="a" data-featherlight-type="image">
{% for photo_url in photo_urls %}
<div class="col-xs-6 col-sm-4 col-md-3">
<a href="{{ photo_url }}=w1200-h1200">
<img src="{{ photo_url }}=w300-h300-c" class="img-responsive" />
</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djangocms-scrape-google-photos-album-0.0.2.tar.gz.
File metadata
- Download URL: djangocms-scrape-google-photos-album-0.0.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d011b406da8ac39db78522e636bbc6dd0ddcbaa0f2ea1ea7166cf52a72d7d2f
|
|
| MD5 |
914398108e3689f9f38817147f8f1760
|
|
| BLAKE2b-256 |
3178baeddc5b9ac039f53ec2e71f95f005e8e16e484f7d87893337a09cbc5714
|
File details
Details for the file djangocms_scrape_google_photos_album-0.0.2-py2-none-any.whl.
File metadata
- Download URL: djangocms_scrape_google_photos_album-0.0.2-py2-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e594ea23cf64406ef5f52a60d0d0ffbdcf32cd6a1a594d373ce406f2cf1d003c
|
|
| MD5 |
92651a8b9954d7b5e04710f057ea20fb
|
|
| BLAKE2b-256 |
e9adaed2b07ccbfd5a27b4b6ee8a3e8d8d193369ab5e3426fae5c518bb63ff70
|