mkiser / WTFJHT

Logging the daily shock and awe in national politics. Read in moderation.

Home Page:https://whatthefuckjusthappenedtoday.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide a static JSON API for a few key status?

natevw opened this issue · comments

Some weeks even these very helpful "executive summaries" are more than I really need to know, but I remain curious as to whether the overall status quo has changed significantly.

What do you think of adding an "API", which really could just be a static file that someone commits to maintaining, that would track a handful of key topics?

{
  "realDonaldTrump": {
    "still_president": true,
    "impeached": false,
  },
  "USAgov": {
    "defcon": 5,
    "aca_repealed": false,
    "daca_going_away": true,
    "travel_ban": ["TCD", "IRN", "LBY", "PRK", "SOM", "SYR", "VEN", "YEM"],
    "wars": […]
   }
}

Some of these are probably frought with peril (e.g. at what point do you say we're at/not at war with N.Korea? what if the Affordable Care Act gets revised but not exactly replaced/repealed?) and could use some honing, and I'm sure there's tons more that could be added…

The idea would be to support things like IFTTT, personal dashboards, single-serving sites for those who'd rather have a "push notification" for certain things rather than having to continually "poll" the news to see if we e.g. have/haven't nuked a roaring mouse.

Good idea! And very similar to something I've been working on in the background: a current status of all the major storylines – kind of like a web app status page (i.e. https://status.github.com/messages). I wasn't thinking quite so binary, but that's an interesting wrinkle to think about.

What else were you thinking / How might this work in practice?

Maybe the way to do it then is to simply base your web app status page on this API, and design the API primarily to support that page. In my mind this could be just a JSON file that gets manually edited. Then your static page would fetch it and use some JS to render or toggle classes or whatever it does.

This keeps things simple and rather than going down a potential rabbit trail of fields and formats and stuff in the abstract, it can start as a concrete "what does my own status page need" implementation.

I don't believe manually editing JSON is a reasonable thing, so it would need a very simple UI at minimum. I'd also want to provide links/footnotes to appropriate news. But I like your idea. How can we move this forward?

Hmm, I'm not sure how this would get a UI. It looks like the site is generated using Jekyll? I haven't used that, but it looks like with that it's either editing JSON or YAML for data anyway. Were you planning on using a different CMS for the status page?

What I've been working on is not an API – it's a content-driven thing. Your idea to have an API is interesting, but I wouldn't – ever – manage it in JSON directly. YAML is a possibility. Even better would be a Jekyll collection made up of individual files with whatever data is necessary. It just can't/won't be a manual editing of a JSON file. It must be managed via structured inputs.

@natevw been thinking about this more. I guess we can handle this as a data file in Jekyll using just YAML. Not super pretty, but it'll do!

Endpoint w/ dummy data here: https://whatthefuckjusthappenedtoday.com/api/v1/status.json

Data file here: https://github.com/mkiser/WTFJHT/blob/master/_data/status.yml

Go nuts! Hope you and others will want to maintain this. Stuff like all the former cabinet members from this thread would be great to get into here.

The structure probably need to be more thoughtful, so feel free to rewrite and make a PR

Cool! You mentioned you were working on a status page?

I have a tendency to overthink things especially in the abstract, so rather than getting bogged down in Semantic Web–level effort to encapsulate the entire state of national and world politics within YAML, what are the key requirements on your end that you want to track the status of? How might they be displayed?

Practical questions this might help answer:

  • what statuses are worth maintaining? e.g. it looks like you might want a timeline of key cabinet/staff member churn?
  • what additional fields need to be in there (links to e.g. news or Wikipedia articles, or back to the main site? mugshot image URLs?)
  • how much should be low-level (true/false, country codes, etc.) vs. higher-level ("Trump has not been formally impeached, but the recent censure by Congress is expected to …")

Obviously the idea of an API is to support automated display of stuff, but given the complexity (and unprecedented absurdity) of everything it might be arrange things to support some future flexibility too. I think that means focusing on specific use cases ("an official status page", "start blinking @natevw's Alexa doohickey orange if there's an actual world-scale news headline [i.e. not just Trump saying another something]", …) and then keeping it simple.

The status page I'm thinking about is a content initiative – probably not an actual status page of binary options.

I honestly haven't thought enough about a WTF Status API to have a very good suggestion here on the structure and level of detail. Let me spend a few days on it and get back to you. I welcome your thoughts/feedback/suggestions on this. I'm probably too close to the subject matter to have much perspective.

I do like the idea of applying the homeland security threat level thing to a handful of big, obvious storylines (i.e. russia, impeachment, travel ban, wall, etc). https://en.wikipedia.org/wiki/Homeland_Security_Advisory_System

Closing due to lack of interest.