An open API service indexing awesome lists of open source software.

https://github.com/circuit/node-linkify

Replace specific text in message via regex. E.g. JIRA titles with an href to that JIRA page
https://github.com/circuit/node-linkify

Last synced: about 1 year ago
JSON representation

Replace specific text in message via regex. E.g. JIRA titles with an href to that JIRA page

Awesome Lists containing this project

README

          

# node-linkify

This node.js web server application parses the text messages sent by the user and converts predefined text with links. The predefined text and its replacement link are configurable for the app.

* node.js web server application for users to activate Circuit Linkify
* Circuit OAuth2 REST API to authenticate and authorize the user (Authorization Grant Flow)
* Circuit node.js SDK to logon on behalf of the user, subscribe to text messages and update text messages

Your post:

Updated by Circuit Linkify on your behalf:

## Requirements
* [node 4.5+](http://nodejs.org/download/)
* [circuit node.js module](https://circuitsandbox.net/sdk/)

## Getting Started

```bash
git clone https://github.com/circuit/node-linkify.git
cd node-linkify
cp config.json.template config.json
```

Edit config.json
* Configure the circuit domain (e.g. circuitsandbox.net)
* Add OAuth2 settings (client_id, client_secret, scope)
* Configure the applications domain and port
* Configure the linkify regex

```bash
"circuit": {
"domain": "circuitsandbox.net",
"client_id": "",
"client_secret": "",
"scope": "READ_USER_PROFILE,READ_CONVERSATIONS,WRTIE_CONVERSATIONS"
},
"app": {
"domain": "http://localhost",
"port": 7100,
"sdkLogLevel": "debug"
},
"linkify": [
{
"title": "Jira (ANS, AAC and CRI links)",
"id": "jira",
"search": "(ANS-[0-9]{1,5}|AAC-[0-9]{1,5}|CRI-[0-9]{1,5})",
"replace": "https:///browse/$1"
},
{
"title": "Gerrit (patch number)",
"id": "gerrit",
"search": "([4-6][0-9]{4})",
"replace": "https:///#/c/$1"
}
]
}
```

Run the sample application with

```bash
npm install
node index.js
```

## Demo video
[![ScreenShot](https://circuit.github.io/images/node-linkify.jpg)](https://circuit.github.io/videos/node-linkify.webm)