项目作者: gusanmaz

项目描述 :
Tweet Caption Bot and CLI.
高级语言: Go
项目地址: git://github.com/gusanmaz/twcapbot.git
创建时间: 2021-05-14T23:39:17Z
项目社区:https://github.com/gusanmaz/twcapbot

开源协议:MIT License

下载


twcapbot - Tweet Caption Bot and CLI

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.

Installation

  1. go get github.com/gusanmaz/twcapbot

  2. cd ${GOPATH}/src/github.com/gusanmaz/twcapbot

  3. go install cmd/tweet-caption-bot/*

  4. go install cmd/tweet-caption-cli/*

    Usage

tweet-captioner-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 into type 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.

tweet-captioner-bot

Usage of bot CLI similar but simpler.

tweet-captioner-bot -creds creds.json -o .

Twitter API Credentials File

Change values of the credentials JSON files according to your API keys.

  1. {
  2. "APIKey": "",
  3. "APISecret": "",
  4. "bearerToken": "",
  5. "accessToken": "",
  6. "accessSecret": ""
  7. }

Author

Güvenç Usanmaz

License

MIT License