docs/config.md

Configuration

All the configuration lives in one place: _auritus.yml.

Required parameters are:

Optional parameters include:

Token

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).

Queries

Your webhose.io queries, required. Note that you can specify more than one query.

Each query must include:

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.

Example

queries:
  - wine:
    - id: 1
    - name: "ML"
    - search: '("machine learning$" OR AI) AND programming is_first:true language:english'

Database

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:

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:

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.

Examples

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.

Style

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

Inverse

Whether to use an inverse navbar (Bootstrap 3), defaults to false.

Theme

A Shiny theme name:

Font

A Google Fonts name, defaults to Raleway. Note that the font will apply to the entirety of the dashboard, including the charts.

Chart theme

An echarts4r theme name:

Segments

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.

Example

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.

Tracking

This is where you can specify your web tracking codes. auritus supports Google Analytics.

Example

tracking:
  ganalytics: "UA-12345-6"

Follow the structure given in the example above.

Examples

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"


JohnCoene/auritus documentation built on March 12, 2020, 8:27 p.m.