• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A python program for downloading images from twitter.

CircleCI

What it does

Download all images uploaded by a specified Twitter user.

What you need

  • Python 3 (>= 3.7)

Setup

First, you need to install twitter-image-dl:

$ pip install twitter-image-dl

Next, you need to generate your api key and api secret key. If you don't have them, go to Twitter Developers and create your application. After you get your api key and api secret key, create a json file like this:

{
  "api_key": "your api key",
  "api_secret": "your api secret key"
}

Usage

To download the images the user of id "foo" has uploaded, enter the command like the following on the command line:

$ twt_img foo -c confidentials.json

where confidentials.json is the json file containing your api keys. This command creates a directory called foo and save images to that directory.

If you want to save images to a directory other than foo, use -d or --dest argument to specify the destination.

You can specify which size of images to download using the optional argument -s (or --size). There are five values you can specify:

  • large
  • medium
  • small
  • orig
  • thumb

If you don't specify this value, images of large size will be downloaded by default.

Using the --rts flag, you can also download images contained in retweets.

Provide a number to the -l or --limit argument (e.g. -l 25) to limit how many tweets are inspected for images (starting with the most recent). Note that if you're using --limit without --rts, the number of tweets inspected can be smaller than the specified limit.

Testing

Install dependencies for testing and run tests like this:

$ git clone [email protected]:morinokami/twitter-image-downloader.git
$ cd twitter-image-downloader
$ pipenv install --dev
$ pipenv run test

More Repositories

1

chinese

Chinese text analyzer
Python
18
star
2

fresh-hacker

Hacker News clone made with Fresh
TypeScript
18
star
3

nature-remo

Python client for Nature Remo API
Python
17
star
4

social_choice

Python program to calculate the winner of well-known winner selection methods, including the plurality method, the runoff method, the elimination method, the Borda count, and the pairwise-comparison method (a.k.a. Condorcet method).
Python
16
star
5

DevToysWeb

DevToys on the web.
TypeScript
9
star
6

shtn

A minimal URL shortener implemented with Hono.
TypeScript
7
star
7

radiko-downloader

radikoのタイムフリーをダウンロードするシンプルなスクリプトです。
Python
6
star
8

nestjs-app

TypeScript
6
star
9

react-ssr

JavaScript
5
star
10

next-zodenv

next-zodenv makes dealing with environment variables in Next.js safer.
TypeScript
5
star
11

webcontainer-fst

Create a WebContainer-compatible FileSystemTree from a given path
TypeScript
4
star
12

tynx

TypeScript
2
star
13

bun-astro-cloudflare

Astro project built with Bun 1.0 and deployed to Cloudflare Pages
Astro
2
star
14

py3dot

Python 3 interface for Graphviz
Python
2
star
15

TagRemover

A super simple implementation of HTML tag remover.
Python
1
star
16

typed-vue3-nuxtbnb

Vue
1
star
17

pokemon-dialog

Python
1
star
18

dns-weekend-deno

https://implement-dns.wizardzines.com/ translated into Deno.
TypeScript
1
star
19

flask-langchain-qdrant

Python
1
star
20

astro-islands

Astro
1
star
21

webcontainer-tutorial

JavaScript
1
star
22

zenn-docs

Shell
1
star
23

vue-docs-chinese-vocab

Shell
1
star
24

dotfiles

Vim Script
1
star
25

nextjs-blog

JavaScript
1
star
26

astro-tutorial

Astro
1
star
27

annotated-react-fiber

TypeScript
1
star
28

nuxt-ecs-fargate

Vue
1
star
29

ptree

tree command prettified with emojis🌲
TypeScript
1
star
30

getting-started-with-fresh

TypeScript
1
star
31

kozos-build-server

書籍『12ステップで作る組込みOS自作入門』のためのビルド環境。
Dockerfile
1
star