Oxygen18 uses a WebSocket-based protocol for sending feed information to the client.
The basic structure is by sending JSON encoded messages over the WebSocket channel.
This document will serve as a living draft of the protocol used between the client and server, and will evolve over time.
Clients can send requests to the server.
{
id: integer, // Monotonically incrementing. Must be >= 0.
body: {
type: string,
...
}
}
The server will send 1 response message for each request it receives.
{
id: integer, // The same value as `request.id`.
body: {
type: string,
...
}
}
Not yet used. These will be used for the server to notify the client of changes, and the client will not respond to them.
{
id: integer, // Monotonically decrementing. Must be < 0.
body: {
type: string,
...
}
}
For all requests, Error
is a valid response.
Returns an array of FeedEntry
objects.
{
type: 'GetLatest',
feed_id: integer?,
offset: integer?,
num_entries: integer,
}
FeedEntries
Returns an array of Feed
objects.
{
type: 'FeedEntries',
}
FeedList
Subscribe to a new feed by URL.
{
type: 'AddFeed',
url: string,
}
Success
Acknowledges servicing of the request.
{
type: 'Success',
}
Failed to service the request, possibly because the request was invalid.
{
type: 'Error',
error: string,
}
A list of FeedEntry
objects.
{
type: 'FeedEntries',
list: FeedEntry[],
}
A list of Feed
objects.
{
type: 'FeedList',
list: Feed[],
}
An object representing a subscription to a given Atom or RSS feed.
{
id: integer,
last_update: integer, // Seconds since Unix Epoch.
title: string,
url: string,
}
An object representing a single entry from Feed
.
{
feedId: integer,
title: string,
id: string,
updated: integer, // Seconds since Unix Epoch.
summary: string,
content: string, // Can be HTML.
}