Skip to content

aditya-an1l/tweet-from-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Tweet - From - Console


🐦 Send tweets right from your terminal. No browser needed!

Tweet from Console is a Python-based command-line tool that lets you tweet directly from your console, command prompt, or terminal. Say goodbye to distracting web interfaces.

Good for programmers and devs who want to send tweets without leaving their console.

🎞️ Preview

Preview GIF

TOC

✨ Features

  • 📝 Send text-based tweets from the command line
  • ⏲️ Fast, simple and straight-forward
  • 🔑 Secure integration with Twitter API

🛠️ Prerequisites

  • 🐍 Python 3.6 or higher
  • 🐦 Twitter Developer Account and API keys

🚀 Installation

  1. Clone the repository:
  2. git clone https://github.com/yourusername/tweet-from-console.git
    cd tweet-from-console
      
  3. Create and activate a virtual environment:
  4. python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Script\activate`
      
  5. Install the required dependencies:
  6. pip install -r requirements.txt
  7. Set up your Twitter API credentials:
    • Rename scripts/.env.example to scripts/.env
    • Open scripts/.env and fill in your Twitter API credentials

⚙️ API key configuration guide

Ensure your scripts/.env file contains these Twitter API credentials:


TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET_KEY=your_api_secret_key
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret

How to get the API keys?

Following guides would help you get the API keys from Twitter/X Developers Platform:

🎮 Usage

1. Tweet with Confirmation Message 🔔

python tweet.py "Your awesome tweet goes here!"

This will give you a confirmation message like the following:

You sure you want to post "Your awesome tweet goes here!" ?
[ (Y)es / (N)o ] :
Type Here:

2. Tweet without Confirmation Message ⏩

python tweet.py "Your awesome tweet goes here!" --

This would not ask for a confirmation message. It directly posts your tweet.

3. View Tweet History 📝

python tweet.py -th 
python tweet.py --tweethistory 

Where <num> is the number of recent items to display.

4. Multi Line Tweet 📜

python tweet.py

Running this simple code would allow users to send multiline tweets. This is helpful since consoles are usually limited to inline inputs.

After writing the tweet, go to new line and then type :q to exit.

Note: If you want to skip the confirmation message, just like Usage 1, execute python tweet.py --

Note: You can execute multiline tweets in a single line using the \n. The following is an example:

python tweet.py "Line 1 \n Line 2"

Here is the format of the tweet that would be posted:

Line 1
Line 2  

4. View Error Logs ⚠️

python tweet.py -e 
python tweet.py --error 

🤝 Contributing

Contributions are welcome! Feel free to submit a Pull Request and join our tweeting revolution! 🌟

⚠️ Disclaimer

This tool is for educational purposes only. Always comply with Twitter's terms of service and API usage guidelines. Tweet responsibly.