-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve API #32
Comments
you could:
|
I just had a look round the source but couldn't find the code controlling the API. Could you point me in the right direction? |
A bite-sized today's update API; issue #32
Dope improvement by @milo-wata (#94). I'm going to put together a very light requirements doc for fully spec'ing what I need with the API. tl;dr this is a great improvement. thank you. |
Basic product reqs are here: https://github.com/mkiser/WTFJHT/wiki/API-Specs It's a starting point for a discussion. Let's talk! |
Thinking about offering a real API leads me to desire something that would be slightly more dynamic than what Jekyll offers: it's hard to build a robust and scalable API off a static site. I'm limited in my knowledge of what the options are, but I'd imagine we'd want a webapp running a more customizable API than what we have. The database layer could still run off the static Jekyll (like we could still use the I am of the opinion that this would be better than relying on Jekyll to statically build multiple versions of each day's post and such for API output, which would bloat the size by a ton. |
Agreed @milo-wata. I think something like Node would work well for something like this. Depending on what the requirements are this needn't be a huge amount of work. I'd be happy to contribute to this FYI. |
Nvm I found it. |
Yep, another option is Sinatra, which appears like it might play nice with Jekyll: either running the rest of the Jekyll blog on top of Sinatra along with the API, or have it be separate. |
API is here: https://github.com/mkiser/WTFJHT/blob/master/api/v1/posts.json This setup works well. I'd love to further parse this to include a structured list of all the external links found in the daily post. It would also be great if this and the "today" api could be merged so there is a parsed out list of "blurbs" see: https://github.com/mkiser/WTFJHT/blob/master/api/today.json |
This API makes me sad. Here's what I'd like to see:
The {
"author": <author>,
"date": <yyyy-mm-dd>,
"summary": <today-in-one-sentence>,
"title": <title>,
"url": <url>,
"stories": [
{"id": 0, "story": <story-content>},
{"id": 1, "story": <story-content>},
...
{"id": 2, "story": <story-content>}
]
} This way, you could just GET {
"author": "Matt Kiser",
"date": "2020-11-03",
"summary": "Trump defeated in the polls!",
"title": "Day whatever: \"FAKE ELECTION!\"",
"url": "https://.....",
"stories": [
{"id": 0, "story": "Trump was handily defeated at the polls today, ending his four years of terror on the country and world."},
]
} If you did this, I could make #102 happen pretty easily. :) |
I was pondering this more as I lay awake in bed last night. You might also want an endpoint such as:
|
This would all be ideal. The API today is just a flat json file that's built the same way everything else on the site is. |
Current API returns each day's update as a single response. Would like to find a way to break this down so each day has multiple sub-items representing each news blurb.
Note: editorial workflow needs to remain the same (building site via the static markdown file), so this would require a post-processing approach.
https://whatthefuckjusthappenedtoday.com/api/v1/pages.json
The text was updated successfully, but these errors were encountered: