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
- Host: GitHub
- URL: https://github.com/circuit/node-linkify
- Owner: circuit
- Created: 2016-10-11T23:41:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-07-26T14:32:32.000Z (almost 7 years ago)
- Last Synced: 2025-02-09T20:33:39.690Z (over 1 year ago)
- Language: JavaScript
- Size: 560 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
[](https://circuit.github.io/videos/node-linkify.webm)