walkeriniraq/twitarr — pull request #140 by jdstapleton (2014-11-24 05:19:29+00:00)
Title: Stream api

create -> POST /api/v2/stream
{"text": "the message"}
most recent (default 20) -> GET /api/v2/stream
list of tweets {ID, text, author, timestamp, epoch}
Optional query param: limit => postive integer

Tweets newer than time -> GET /api/v2/stream?start=epoch
epoch => unix timestamp in millis
limit => positive integer

Tweets older than time -> GET /api/v2/stream?start=epoch&older_posts=true
limit => positive integer

Resulting index:
{"stream_posts":[{"id":"547217056313b18cd500001e","author":"kvort","text":"@james challenge accepted.","timestamp":"2014-10-14T11:31:00.000Z","epoch":1413286260000,"photo":null}, ...],"next_page":1413286019999}

--------
Get tweet by ID -> GET /api/v2/stream/tweet_id
{"id":"547217056313b18cd500001e","author":"kvort","text":"@james challenge accepted.","timestamp":"2014-10-14T11:31:00.000Z","epoch":1413286260000,"photo":null}

DELETE tweet by ID -> DELETE /api/v2/stream/tweet_id