xslicer is a Go-based command-line tool that helps you split long text into tweetable chunks (280 characters or less) and save them as a thread. Itโs perfect for turning long paragraphs into Twitter-friendly threads!
- Split Long Text: Easily split long text into tweet-sized chunks.
- Thread Numbering: Automatically adds thread numbering (e.g., "1/5", "2/5") to each tweet.
- File Support: Accepts input from both direct text and text files.
- Save Output: Save the sliced tweets to an output file.
- Append Mode: Optionally append tweets to an existing file.
- Verbose Mode: Get detailed information about the process (e.g., number of tweets generated).
- Customizable: Set a custom character limit for tweets.
- Go: Make sure you have Go installed. You can download it from here.
- Clone the repository:
git clone https://github.com/ansgrb/xslicer.git cd xslicer
- Build the project:
go build -o tweet-slicer
- Run the app:
./xslicer -file input.txt -output output.txt -verbose
- Split Text from a File:
./xslicer -file input.txt -output output.txt
- Split Direct Text Input:
./xslicer -text "Your long text here..." -output output.txt
- Append Tweets to an Existing File::
./xslicer -file input.txt -output output.txt -append
- Set Custom Tweet Length:
./xslicer -file input.txt -maxlength 100 -output output.txt
- Enable Verbose Mode:
./xslicer -file input.txt -output output.txt -verbose
This is a long text that needs to be split into multiple tweets because it exceeds the character limit of a single tweet.
The goal is to ensure that no word is split in the middle and that each tweet is concise and readable.
This app will handle the splitting and add thread numbering to make it easy to follow.
./tweet-slicer -file input.txt -output output.txt -verbose
1/3 This is a long text that needs to be split into multiple tweets because it exceeds the character limit of a single tweet. The goal is to ensure that no word is split in the middle and that each tweet is concise and readable.
---
2/3 This app will handle the splitting and add thread numbering to make it easy to follow.
---
Tweets saved to output.txt
Generated 2 tweets.
Max tweet length: 280 characters.
Tweets were written to the output file (overwritten if it existed).
Flag | Description |
---|---|
-text |
Direct text input to split into tweets. |
-file |
Path to a text file containing the input. |
-output |
Path to save the output tweets (e.g., output.txt ). |
-append |
Append tweets to the output file instead of overwriting it. |
-maxlength |
Maximum length of each tweet (default: 280). |
-verbose |
Print additional information (e.g., number of tweets generated). |
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.