1.0.0 • Published 6 years ago

wtfjht-client v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

wtfjht-client

Build Status codecov npm npm

Introduction

Going to https://whatthefuckjusthappenedtoday.com/ is "today's essential guide to the daily shock and awe in national politics."

It has a very basic API with three endpoints

  • /api/today.json
    • A list of things that have happened today
  • /api/v1/random.json
    • A list of all the days, along with the URLs for the specific pages for those days
    • I think the endpoint is called random because it powers the "choose random day" feature
  • /api/v1/status.json
    • A basic status page with information like "has Trump been impeached"

API

  • getToday - get all the fucking stories that fucking happened today
import { getToday } from 'wtfjht-client';

const whatTheFuckJustHappenedToday = await getToday();
  • getAllDailyPages - get details for all tracked days
import { getAllDailyPages } from 'wtfjht-client';

const allDailyPages = await getAllDailyPages();
  • getStatus - get the current state of things
import { getStatus } from 'wtfjht-client';

const status = await getStatus();