Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mseri/tweetpix
A small script, on its way to become a bot, to get appropriate CC images from flickr, pixellize them and publish them on twitter
https://github.com/mseri/tweetpix
Last synced: 2 months ago
JSON representation
A small script, on its way to become a bot, to get appropriate CC images from flickr, pixellize them and publish them on twitter
- Host: GitHub
- URL: https://github.com/mseri/tweetpix
- Owner: mseri
- License: gpl-2.0
- Created: 2015-07-14T10:29:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-12T21:19:09.000Z (about 9 years ago)
- Last Synced: 2023-06-09T01:16:00.450Z (over 1 year ago)
- Language: Python
- Size: 141 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tweetpix
A small script that gets CC images from flickr, pixellizes them and publishes them on your twitter.
Create a file called `keys.py` in the same folder as the rest of the scripts, then add the following lines
```{python}
keys = dict(
consumer_key = 'STUB',
consumer_secret = 'STUB',
access_token = 'STUB',
access_token_secret = 'STUB',
flickr_key = 'STUB',
flickr_secret = 'STUB',
)
```
(where you replace the STUBS with your API Keys obtained from flickr and twitter).Then the usage is pretty simple:
```{bash}
./tweetpix.py SEARCH_STRING
```
where `SEARCH_STRING` is some string used as search on flickr. The script will download a CC licensed picture searching for `SEARCH_STRING`, save it locally, pixellize it and tweet it.E.g.
```
./tweetpix.py "london fireworks"
(1200, 630)
#pixellized version of www.flickr.com/photos/24101343@N08/6824713499. Search 'london fireworks', baseline 72px, long side 1200px
```
produced the following tweet https://twitter.com/marcelloseri/status/664914489230426112## Pixellize
The pixellizer library can be used as a standalone cli application:```{bash}
./pixellize.py
Pixellize
Generates a "pixellated" copy of IMAGEFILE.Usage:
pixellize.py [--length=L] [--pixels=P] IMAGEFILE
pixellize.py -h | --helpOptions:
-h --help Show this screen.
--length=L Lenght of the longest edge [default: 288].
--pixels=P Number of pixels to appear on the longest edge [default: 72].
```