Introduction

Queries can be sent to the Erssical HTTP server, which will take care of fetching RSS channels, merging and filtering items and finally return a new RSS channel or Ical data.

Launching the server

Synopsis:

erssical-server [options]

Options are:

  -p <n> Listen to port number <n>; default is 8915
  -h <name> Reply to connections on host <name>; default is to reply
		to any query; ("localhost" can be used as <name>)
  -q <n> Set maximum number of pending connections; default is 20
  --ttl <n> When using cache, set default time to live to <n> minutes;
		default is 60
  --auth <file> read authorized query urls from <file>
  --log <file> log to <file>
  -help  Display this list of options
  --help  Display this list of options
API

The HTTP server, when contacted, looks for a query-url argument to fetch the query from. If no such argument is provided, then a query in XML format is looked in the query argument. If no query is provided, the server replies with an error.

The rtype argument can be used to override the return type specified in the query.

After executing the query, the server responds with a document according to the requested return type: application/xml+rss, text/calendar or application/xml.

Command line querying the server

Here are examples of querying the HTTP server from the command line, using the Curl tool. You do not need to have Erssical installed on your machine, but just know about a Erssical server accepting your queries.

curl --data-urlencode query@tests/query.xml localhost:8915
curl -d rtype="text/calendar" \
  --data-urlencode query@tests/query.xml localhost:8915
Embedding results of Erssical in a web page

Example of code providing a link to merged RSS channels:

<a href="http://localhost:8915?query-url=https://framagit.org/zoggy/erssical/-/raw/master/tests/query.xml"><img alt="My merged RSS channel" src="rss.png"/></a>

Example of code providing a link to events in Ical format:

<a href="http://localhost:8915?query-url=https://framagit.org/zoggy/erssical/-/raw/master/tests/query.xml&amp;rtype=ical"><img alt="My merged calendar" height="32" src="Calendar.svg" width="32"/></a>
Security

The HTTP server will only fetch HTTP or HTTPS URLs.

The --auth command line option allows to specify which URLs the queries can be fetched from. Moreover, it forbids sending inline queries: All queries must be indicated by a URL, with the query-url argument. The aim is to be able to link which query URL refers to which channels.

The file passed with option --auth contains lines of the following form:

<regexp matching URLs>[ // optional comment]

The regular expressions handled can contain the various constructions detailed in the OCaml Str module.

Here is an example of such a file:

https?://zoggy\.frama\.io/.* // Ok for Zoggy's urls
https?://framagit.org/zoggy/[^/]+/-/raw/.* // Raw zoggy files from framagit