api-101-workshop

API 101 Workshop: Python

Getting started

To install all of the dependencies, please follow the next steps:

  1. Install Python [Ubuntu or Mac]
  2. Install requests dependency.

     pip install requests
    

APIs

I can haz Dad joke

The largest selection of dad jokes on the internet

python src/i_can_haz_dad_joke.py JOKES_AMOUNT

This script will use a JSON response like this one:

{
  "id": "R7UfaahVfFd",
  "joke": "My dog used to chase people on a bike a lot. It got so bad I had to take his bike away.",
  "status": 200
}

for printing a random Dad joke (and saving it as an image as well) as many times as JOKES_AMOUNT specifies.