https://github.com/circuit/xlator-bot
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items.
https://github.com/circuit/xlator-bot
Last synced: 10 months ago
JSON representation
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items.
- Host: GitHub
- URL: https://github.com/circuit/xlator-bot
- Owner: circuit
- License: mit
- Created: 2015-03-07T19:23:26.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-07-26T13:11:10.000Z (almost 7 years ago)
- Last Synced: 2024-04-11T15:42:31.132Z (about 2 years ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 5
- Watchers: 15
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xlator-bot
This sample application shows how to receive Circuit Conversation updates and how to send Circuit conversation items with the [circuit node SDK](https://circuitsandbox.net/sdk/)
## Recommended ##
* [node 6.x LTS](http://nodejs.org/download/)
* [circuit module](https://circuitsandbox.net/sdk/)
## Getting Started ##
```bash
git clone https://github.com/circuit-sandbox/xlator-bot.git
cd xlator-bot
cp config.json.template config.json
```
Edit config.json
* Change "client_id" and "client_secret" to the circuit account you'll use for the Xlator Bot.
you can request client credentials for bots here https://circuit.github.io/oauth.html.
* Change the apiKey to a google "Key for server applications" with access to the "Translate API".
```bash
"client_id" : "your circuit client id",
"client_secret" : "your circuit secret",
"domain" : "circuitsandbox.net",
"apiKey" : "google translation API key",
```
Run the sample application with
```bash
npm install
node index.js
```
Add the Xlator Bot user to one of your circuit conversations. The Xlator Bot will translate posts and reply with a comment. By default translation is done to English. The Xlator Bot will attempt to translate to another language if the first word of a post matches one of the languages in lang.json.