Hey, I enjoyed the idea so I made this code to support the basic WordPress post data inside Timeline, using the JSON API plugin with a custom cotroller.
Here’s the code:
https://pastebin.com/SwbT2J9A
You should paste this under /wp-content/plugins/json-api/controllers/ as timeline.php
Usage:
https://example.com/api/timeline/category_posts/?category_id=123&post_type=timeline&amount=10&main_post_id=456
Default values:
category_id = null
post_type = ‘post’
amount = -1 (all posts)
main_post_id = first post from query, ordered by date in ascending order (the main post should be an introduction to the timeline being viewed)
Content values can (and would be nice) be changed to support custom post meta for enhanced usage.
If you have any ideas to improve this code, let me know.