Merge branch 'master' into moderation-docs

This commit is contained in:
Wyatt Johnson
2018-11-01 16:03:14 +00:00
committed by GitHub
15 changed files with 967 additions and 124 deletions
+181
View File
@@ -0,0 +1,181 @@
---
title: Configuration with CLI tools
permalink: /configuration-cli-tools/
class: configuration
toc: true
---
Talk can be configured using CLI tools. The CLI tools are available through `./bin/cli`. Below is a list of commands available:
```
Usage: cli [options] [command]
Options:
-h, --help output usage information
Commands:
serve serve the application
db run database commands
settings interact with the application settings
assets interact with assets
setup setup the application
jobs work with the job queues
token work with the access tokens
users work with the application auth
migration provides utilities for migrating the database
plugins provides utilities for interacting with the plugin system
help [cmd] display help for [cmd]
```
## Serving the application
To serve the application, run `./bin/cli serve`. Please check that you have installed the Talk before doing this step. Below is a list of additional options available for this command:
```
Usage: cli-serve [options]
Options:
-j, --jobs enable job processing on this thread
--disabled-jobs <jobs> disable jobs specified if the -j option is passed, specified as a comma separated list (default: )
-w, --websockets enable the websocket (subscriptions) handler on this thread
-h, --help output usage information
```
## Database commands
You can also run database commands using `./bin/cli db`. Below is a list of additional options available for this command:
```
Usage: cli-db [options] [command]
Options:
-h, --help output usage information
Commands:
createIndexes creates the database indexes and waits until they are created
```
## Application settings
You can also change application settings using `./bin/cli settings`. Below is a list of additional options available for this command:
```
Usage: cli-settings [options] [command]
Options:
-h, --help output usage information
Commands:
change-org-name change the organization name
```
## Interaction with assets
You can also interact with your application's assets using `./bin/cli assets`. Below is a list of additional options available for this command:
```
Usage: cli-assets [options] [command]
Options:
-h, --help output usage information
Commands:
list [options] list all the assets in the database
refresh [age] queues the assets that exceed the age requested
update-url <assetID> <url> update the URL of an asset
merge <srcID> <dstID> merges two assets together by moving comments from src to dst and deleting the src asset
rewrite [options] <search> <replace> rewrites asset url's using the provided regex replacement pattern
```
## Setting up the application
You can also run a setup wizard to setup the wizard using `./bin/cli setup`. Below is a list of additional options available for this command:
```
Usage: cli-setup [options]
runs the setup wizard to setup the application
Options:
--defaults apply defaults for config instead of prompting
-h, --help output usage information
```
## Working with job queues
You can also work with job queues using `./bin/cli jobs`. Below is a list of additional options available for this command:
```
Usage: cli-jobs [options] [command]
Options:
-h, --help output usage information
Commands:
process starts job processing
cleanup [options] cleans up inactive jobs
```
## Working with access tokens
You can also work with access tokens using `./bin/cli token`. Below is a list of additional options available for this command:
```
Usage: cli-token [options] [command]
Options:
-h, --help output usage information
Commands:
list <userID> list tokens for a user
revoke <tokenID> revokes a token with a given id
create <userID> <tokenName> create a token for a user with a given name
```
## Working with your application's authentication
You can also work with your application's authentication using `./bin/cli users`. Below is a list of additional options available for this command:
```
Usage: cli-users [options] [command]
Options:
-h, --help output usage information
Commands:
create creates a local user
delete <userID> delete a user
list searches for a user based on their stored username and email
set-role <userID> sets the role on a user
verify <userID> <email> verifies the given user's email address
```
## Migrating your database
Talk provides utilities for migrating your database using `./bin/cli migration`. Below is a list of additional options available for this command:
```
Usage: cli-migration [options] [command]
Options:
-h, --help output usage information
Commands:
create <name> creates a new migration
run [options] runs all pending migrations
```
## Interacting with the plugin system
Talk provides utilities to interact with the plugin system using `./bin/cli plugins`. Below is a list of additional options available for this command:
```
Usage: cli-plugins [options] [command]
Options:
-h, --help output usage information
Commands:
create creates a seed plugin
list
reconcile [options] reconciles dependencies by downloading external plugins
```
+44
View File
@@ -0,0 +1,44 @@
---
title: Asset Scraping
permalink: /integrating/asset-scraping/
---
By default, Assets in Talk have their metadata scraped when they are loaded.
This provides the easiest way for newsrooms to integrate their CMS's into Talk
in a simple way. We use the following
[meta tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) on
the target pages that allow us to extract some properties.
| Asset Property | Selector |
|--------------------|----------|
| `title` | See [`metascraper-title`](https://github.com/microlinkhq/metascraper/blob/dc664c37ea1b238b1e3e9d5342edfacc9027892c/packages/metascraper-title/index.js) |
| `description` | See [`metascraper-description`](https://github.com/microlinkhq/metascraper/blob/dc664c37ea1b238b1e3e9d5342edfacc9027892c/packages/metascraper-description/index.js) |
| `image` | See [`metascraper-image`](https://github.com/microlinkhq/metascraper/blob/dc664c37ea1b238b1e3e9d5342edfacc9027892c/packages/metascraper-image/index.js) |
| `author` | See [`metascraper-author`](https://github.com/microlinkhq/metascraper/blob/dc664c37ea1b238b1e3e9d5342edfacc9027892c/packages/metascraper-author/index.js) |
| `publication_date` | See [`metascraper-date`](https://github.com/microlinkhq/metascraper/blob/dc664c37ea1b238b1e3e9d5342edfacc9027892c/packages/metascraper-date/index.js) |
| `modified_date` | `meta[property="article:modified"]` |
| `section` | `meta[property="article:section"]` |
You can use the `./bin/cli assets debug <url>` to print the scraped metadata
from that URL. For example:
```bash
$ ./bin/cli assets debug https://www.washingtonpost.com/technology/2018/10/30/apple-event-october-ipad-pro-macbook-air/
┌──────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Property │ Value │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ title │ Apple redesigns the iPad Pro, breathes new life in the MacBook Air │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ description │ Apple is unveiling new iPads and MacBooks at an event in New York starting at 10 a.m. Fowler is there and will report in with the news and hands-on analysis throughout the day. │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ image │ https://www.washingtonpost.com/resizer/JAwNQE2alL2JjiWrbXeJ46wZHqA=/1484x0/arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/G5TWBFW4LAI6RC5MX7QB7TODUY.jpg │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ author │ Geoffrey A. Fowler │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ publication_date │ 2018-10-30T10:40:00.000Z │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ modified_date │ │
├──────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ section │ │
└──────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```