Skip to content
/ xslicer Public

A Go-based command-line tool to split long text into tweetable chunks (280 characters or less) with thread numbering. Perfect for creating Twitter threads from lengthy content! Supports file input, output saving, append mode, and verbose logging. ๐Ÿš€

Notifications You must be signed in to change notification settings

ansgrb/xslicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

xslicer โœ‚๏ธ

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!

Features โœจ

  • 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.

Installation ๐Ÿ› ๏ธ

Prerequisites

  • Go: Make sure you have Go installed. You can download it from here.

Steps

  1. Clone the repository:
    git clone https://github.com/ansgrb/xslicer.git
    cd xslicer
  2. Build the project:
     go build -o tweet-slicer
  3. Run the app:
     ./xslicer -file input.txt -output output.txt -verbose

Usage ๐Ÿš€

  1. Split Text from a File:
     ./xslicer -file input.txt -output output.txt
  2. Split Direct Text Input:
     ./xslicer -text "Your long text here..." -output output.txt
  3. Append Tweets to an Existing File::
     ./xslicer -file input.txt -output output.txt -append
  4. Set Custom Tweet Length:
    ./xslicer -file input.txt -maxlength 100 -output output.txt
  5. Enable Verbose Mode:
     ./xslicer -file input.txt -output output.txt -verbose

Example ๐Ÿ“

Input File (input.txt)

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.

Command

./tweet-slicer -file input.txt -output output.txt -verbose

Output File (output.txt)

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.
---

Verbose Output

Tweets saved to output.txt
Generated 2 tweets.
Max tweet length: 280 characters.
Tweets were written to the output file (overwritten if it existed).

Command-Line Flags ๐ŸŽฏ

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).

Contributing ๐Ÿค

Contributions are welcome! If you'd like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

Happy Slicing!

About

A Go-based command-line tool to split long text into tweetable chunks (280 characters or less) with thread numbering. Perfect for creating Twitter threads from lengthy content! Supports file input, output saving, append mode, and verbose logging. ๐Ÿš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages