Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ahmedkhalf/dadjokes-plus-plus
- Owner: ahmedkhalf
- License: mit
- Created: 2020-07-31T18:44:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-04T14:52:00.000Z (over 4 years ago)
- Last Synced: 2024-11-14T11:51:40.124Z (about 2 months ago)
- Topics: cli, cli-app, comedy, command-line, dad, dad-jokes, dadjokes, icanhazdadjoke, jokes, python, python3, requests, terminal
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Image of dadjokes++ geting used on terminal startup.
# 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"))
```