PrankLineCrafter is an idea by @tuxerrante.
PrankLineCrafter is a Python script that generates humorous stories based on names provided in a text file and submits these stories to a server via HTTP POST requests. The stories are generated using the LlamaAPI, which is integrated into the script to create engaging and amusing content.
- Reads names from a
names.txt
file or from a specified file path. - Generates a funny story for each name using the LlamaAPI.
- Sends each name and its corresponding story to a specified server URL via HTTP POST requests.
- Handles environment variables for sensitive information such as API tokens and server URLs.
- Python 3.9 or higher
requests
libraryllamaapi
librarypython-dotenv
library
-
Clone this repository:
git clone https://github.com/Noblesix960/PrankLineCrafter.git cd PrankLineCrafter
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the repository with the following content:LLAMA_API_TOKEN=your_llama_api_token URL=your_target_url
Replace
your_llama_api_token
with your LlamaAPI token andyour_target_url
with the URL of the server where you want to send the generated stories. -
Prepare a
names.txt
file in the root directory with one name per line. -
Run the script:
python main.py
The script will read names from names.txt, generate a story for each name, and send the results to the specified server.
-
(Optional) To specify a different file containing the names, provide the file path as an argument:
python main.py path/to/your/other_names.txt
If no file path is provided, the script defaults to using
names.txt
.
- If the specified file (or
names.txt
if no file is specified) is missing, the script will notify you with an error message. - If the server responds with an error, the script will print the status code for debugging purposes.
Given a names.txt
file with the following content:
Alice
Bob
Charlie
The script will generate and send stories for "Alice", "Bob", and "Charlie" to the specified server.
Contributions are welcome! Please open an issue or submit a pull request with improvements or bug fixes.