Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahmedkhalf/dadjokes-plus-plus

Dad jokes on steroids.
https://github.com/ahmedkhalf/dadjokes-plus-plus

cli cli-app comedy command-line dad dad-jokes dadjokes icanhazdadjoke jokes python python3 requests terminal

Last synced: about 1 month ago
JSON representation

Dad jokes on steroids.

Awesome Lists containing this project

README

        




Image of dadjokes++ geting used on terminal startup.




GitHub forks


GitHub stars


GitHub watchers



Downloads


Downloads/Month


Downloads/Week


# Dadjokes++
Dad jokes on steroid.

Fetch jokes from icanhazdadjoke. Unlike other alternatives, dadjokes++ can download all jokes to your computer for faster and offline retrieval.

## Installation

Make sure you have python 3 and pip installed, then execute this in your terminal:

```bash
pip install dadjokes-plus-plus
```

## Usage

### From terminal

#### Fetch a random joke online
```bash
$ dadjokes
I used to be a banker, but I lost interest.
```

#### Download all jokes to jokes.txt
```bash
$ dadjokes -d "jokes.txt"
```

#### Load a random joke from jokes.txt
```bash
$ dadjokes -l "jokes.txt"
A steak pun is a rare medium well done.
```

*Note:* if you don't provide -d or -l a path it will automatically be "jokes.txt".

### From python

#### Fetch a random joke online
```python
import dadjokes
print(dadjoke.joke())
```

#### Download all jokes to jokes.txt
```python
import dadjokes
print(dadjoke.save_jokes("jokes.txt"))
```

#### Load a random joke from jokes.txt
```python
import dadjokes
print(dadjoke.joke("jokes.txt"))
```