All the configuration lives in one place: _auritus.yml
.
Required parameters are:
database
: to define the database used to store the data.token
: your webhose.io token to collect the data.queries
: your boolean searches to query the data.Optional parameters include:
style
: customise the visual appearance of the platform.segments
: Segment your data.tracking
: Google Analytics tracking.Your required webhose.io token. Simply create a free account to get it. webhose.io provides 1,000 free queries per month, which, if maximised, can add up to as many as 100,000 results (blog posts and news articles).
Your webhose.io queries, required. Note that you can specify more than one query.
Each query must include:
id
: A unique integer.name
: Which will be displayed on the platform.query
: Boolean webhose.io query., at least one.It is essential you read through the webhose's guide on boolean queries before settings this up. It will avoid you wasting precious queries or collecting data that is not relevnt to your use case.
queries:
- wine:
- id: 1
- name: "ML"
- search: '("machine learning$" OR AI) AND programming is_first:true language:english'
This is required, it lets you to make use of a database to store the data. If omitted the function setup_auritus
will fail and prompt you to specify one.
Currently, auritus supports:
SQLite
MySQL
PostgreSQL
MariaDB
The default setup as provided by init_auritus
, uses an SQLite
database which is the simplest possible to setup. SQLite does not require you to setup anything so leave it as is if you do not know about databases.
SQLite is not advised, it should only be used locally for testing purposes.
You are advised to use another type
such as Postgres
which will be much more performant and not stored on disk. However, SQLite might be good enough, depending on the amount of data you expect.
Most of the computations are handled by the database via SQL, it is therefore advised to use a databse other than SQLite in deployment.
When using a database you must specify, at least:
type
dbname
: name of your database.Specify the type
, by name, as listed above under supported types, see the example. These arguments are then passed to DBI::dbConnect
, you may therefore pass other arguments, such as host
, port
, user
, password
, group
, depending on the database type
you are using.
An SQLite database (default).
database:
type: SQLite
dbname: auritus
A Postgres database.
database:
type: Postgres
dbname: auritus
host: "http://192.167.101.22"
user: postgres
password: 123456
Note that you may need to create the database yourself before referencing it in _auritus.yml
, depending on the database type
you use.
You can customise the appearance of the platform under style
. All of these are optional.
The default configuration looks like this:
style:
theme: paper
font: Raleway
chart_theme: auritus
inverse: false
Whether to use an inverse navbar (Bootstrap 3), defaults to false
.
A Shiny theme name:
cerulean
cosmo
cyborg
darkly
flatly
journal
lumen
paper
(default)readble
sandstone
simplex
slate
spacelab
superhero
united
yeti
A Google Fonts name, defaults to Raleway
. Note that the font will apply to the entirety of the dashboard, including the charts.
default
auritus
(default)dark
vintage
westeros
essos
wonderland
walden
chalk
inforgraphic
macarons
roma
shine
purple-passion
halloween
This is where you define, optional, segments. This segments allow you the essentially categorise your data based on a regular expression. The regular expression is passed the R function grep
, make sure it is valid.
The query
parameter refers to the id the query
to apply the segment to.
Note that segments are not mutually exclusive, one article may be in one than more category.
segments:
- segment:
- query: 1
- name: "Rosé"
- regex: "Rosé|rosé"
- segment:
- query: 1
- name: "White"
- regex: "White|white"
- segment:
- query: 1
- name: "Red"
- regex: "Red|red"
- segment:
- query: 1
- name: "Bubbles"
- regex: "Bubbles"
Follow the structure given in the example above.
This is where you can specify your web tracking codes. auritus supports Google Analytics.
tracking:
ganalytics: "UA-12345-6"
Follow the structure given in the example above.
Below is an example setup where defaults can be used.
# theme
style:
theme: paper # from: https://rstudio.github.io/shinythemes/
font: Raleway # google font
chart_theme: default # echarts4r theme, from: https://echarts4r.john-coene.com/articles/themes
inverse: false # Whether to use inverse navbar (Bootstrap 3)
# your webhose token
# free @ webhose.io
token: "xx12484x-13xx-29x1-x12x-9725382618x1"
# minimum setup = 1 query
# each query MUST have an id and a search
queries:
- wine:
- id: 1
- name: "Yellow Tail"
- search: '("Yellow Tail" OR "Mateus$") AND "wine$" is_first:true language:english'
# segments to categorise your data
# regex:
# | => OR
# & => AND
segments:
- segment:
- query: 1
- name: "Rosé"
- regex: "Rosé|rosé"
- segment:
- query: 1
- name: "White"
- regex: "White|white"
- segment:
- query: 1
- name: "Red"
- regex: "Red|red"
- segment:
- query: 1
- name: "Bubbles"
- regex: "Bubbles"
# analytics to track site usage
tracking:
ganalytics: "UA-12345-6"
# database
# must include type
# must include dbname
# Any other option to pass to DBI::dbConnect
database:
type: "SQLite"
dbname: "articles"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.