This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Twitter Photos is a command-line tool to get photos from Twitter accounts.

Requirements

  • python-twitter
  • requests
  • urllib3

Installation

You can install the package with pip:

$ pip install twitter-photos

Or, you can download a source distribution and install with these commands:

$ python setup.py install

How It Works

The command-line front-end of Twitter Photos, “twphotos”, downloads photos from specified Twitter accounts into individual directories each named after username. It hits the Twitter API as little as possible to retrieve photos links and download each link separately. You can view the links yourself and pipe them to other programs such as wget. You can specifiy photo size, number of photos to get, and whether to download only new photos since last downloads.

Setup

Create a config file at ~/.twphotos specifying your Twitter credentials (you can create an app and get your keys at Twitter Application Management):

[credentials]
consumer_key = your_consumer_key
consumer_secret = your_consumer_secret
access_token_key = your_access_token_key
access_token_secret = your_access_token_secret

Note that the values on the right side of = should not contain the quotes; they are just themselves since this file is in INI format.

Usage

The simplest usage is to run “twphotos” from command-line without any options. This will download all photos from the current authenticated user (you):

$ twphotos

Download all photos from an existing user other than yourself with -u option followed by username. “twphotos” will automatically create a directory with the specified username and put downloaded photos in there:

$ twphotos -u wired

Download n most recent photos from a user using -n followed by number:

$ twphotos -u wired -n 20

Download photos to a directory other than the current one:

$ twphotos -u wired -o /path/to/dir

Enable “incremental download” to download new photos since the last downloads with -i:

$ twphotos -u wired -i

Enable “parallel download” to speedup the downloads using the -r switch:

$ twphotos -u wired -r

Print username, tweet ids, and URLs instead of downloading them with -p switch:

$ twphotos -u wired -p

Exclude replies tweets using -e switch:

$ twphotos -u wired -e

Download small-sized photos

$ twphotos -u wired -s small

You can retrieve URLs only with cut command:

$ twphotos -u wired -p | cut -d ' ' -f3

Command-line Options

The “twphotos” command accepts the following options:

-u USER, --user USER
 user account
-l LIST_SLUG, --list LIST_SLUG
 list slug with –user as list owner
-o OUTDIR, --outdir OUTDIR
 output directory
-p, --print print media urls and tweet ids instead of download
-r, --parallel enable parallel download
-n NUM, --num NUM
 number of most recent photos to download
-i, --increment
 download only new photos since last download
-e, --exclude_replies
 exclude replies
-s SIZE, --size SIZE
 photo size (large, medium, small and thumb)
-t TYPE, --type TYPE
 timeline type (user and favorites)
Release History

Release History

0.3.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
twitter-photos-0.3.0.tar.gz (83.2 kB) Copy SHA256 Checksum SHA256 Source Aug 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting