A small script, on its way to become a bot, to get appropriate CC images from flickr, pixellize them and publish them on twitter
Find a file
2015-11-12 21:19:04 +00:00
.gitignore updated gitignore 2015-06-30 16:37:16 +01:00
LICENSE Initial commit 2015-07-14 11:29:15 +01:00
pixellize.py First Commit 2015-06-28 13:38:12 +01:00
README.md added readme 2015-11-12 21:19:04 +00:00
requirements.txt Added docstrings and minor fixes 2015-07-18 21:05:51 +01:00
tweetpix.py Added docstrings and minor fixes 2015-07-18 21:05:51 +01:00

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

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:

./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:

./pixellize.py
Pixellize
Generates a "pixellated" copy of IMAGEFILE.

Usage:
  pixellize.py [--length=L] [--pixels=P] IMAGEFILE
  pixellize.py -h | --help

Options:
  -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].