twcapbot provides two distinct programs.
- tweet-captioner-cli CLI tool allows anyone with Twitter API keys to retrieve media of recent (latest 3200 tweets and favorites) tweets of a specific user. Aside from original pictures from tweets, you could retrieve captioned pictures of these pictures. Caption text includes tweet text and some other useful stuff for regarding tweet.
- tweet-captioner-bot When this bot is working users could retrieve captioned images as reply for a particular tweet by simply mentioning this bot's host account.
-
go get github.com/gusanmaz/twcapbot
-
cd ${GOPATH}/src/github.com/gusanmaz/twcapbot
-
go install cmd/tweet-caption-bot/*
-
go install cmd/tweet-caption-cli/*
Command below obtains recent (latest 3200) favorites of @github account and saves media, and captioned media of these tweets into . (current directory)
tweet-captioner-cli -creds creds.json -o . -s github -type fav
- To obtain tweets of a user instead of favorites change
type fav
intotype tweet
- Twitter API credentials are stored in a file and this file's location should be provided as cred flag's value
- We will present an empty credentials file below. Once you obtain Twitter API credentials you could modify this file according to your API keys.
- All output of the command is saved into directory determined by -o flag value.
Usage of bot CLI similar but simpler.
tweet-captioner-bot -creds creds.json -o .
Change values of the credentials JSON files according to your API keys.
{
"APIKey": "",
"APISecret": "",
"bearerToken": "",
"accessToken": "",
"accessSecret": ""
}
Güvenç Usanmaz
MIT License