Skip to content

Latest commit

Β 

History

History
88 lines (57 loc) Β· 1.52 KB

File metadata and controls

88 lines (57 loc) Β· 1.52 KB

havingFun πŸŽ‰

A random joke generator using the Joke API.

Overview

This project fetches random jokes from the Joke API and displays them in a fun way. It's available in both JavaScript (Node.js) and Python.

Features

  • ✨ Fetches random jokes from an external API
  • 🎭 Supports single-part and two-part jokes
  • πŸš€ Simple and easy to use
  • πŸ“¦ Available in JavaScript and Python

Installation

JavaScript/Node.js

No external dependencies needed! Just use Node.js built-in modules.

node joke-generator.js

Python

Install the required package:

pip install requests

Then run:

python3 joke-generator.py

Usage

Simply run the script:

JavaScript:

node joke-generator.js

Python:

python3 joke-generator.py

The script will fetch and display a random joke from the Joke API.

API Details

This project uses the Joke API which provides:

  • Single-part jokes: Simple one-liner jokes
  • Two-part jokes: Setup and punchline format
  • Multiple categories: Programming, knock-knock, general, etc.

Examples

🎭 Fetching a random joke...

Why do Java developers wear glasses?
Because they don't C#

πŸ˜„ Enjoy!

License

CC0-1.0 (Creative Commons Zero v1.0 Universal)

Contributing

Feel free to enhance this project! Some ideas:

  • Add joke filtering by category
  • Cache jokes locally
  • Create a web interface
  • Add more API options

Built with ❀️ for fun!