Permalink
Browse files

update docs

  • Loading branch information...
dustinblackman committed Feb 22, 2017
1 parent 2d3e06e commit 79b357fbf4228d39d288e3246e78791216de725b
View
@@ -8,9 +8,9 @@
# Broid
-Broid Integrations is an open source project providing a suite of Activity Streams 2 libraries for unified communications among a vast number of communication platforms.
+Broid Integrations is an open source project providing a suite of Activity Streams 2 libraries for unified interface among a vast number of communication platforms.
-> Connect your App to Multiple Messaging Channels with One OpenSource Language.
+> Connect your App to Multiple Messaging Channels with One OpenSource Language.
<br>
<a href="https://github.com/broidHQ/integrations">
@@ -20,54 +20,76 @@ Broid Integrations is an open source project providing a suite of Activity Strea
<br>
[![gitter](https://badges.gitter.im/broidHQ/broid.svg)](https://t.broid.ai/c/Blwjlw?utm_source=github&utm_medium=readme&utm_campaign=top&link=gitter)
-## Install
-
-```bash
-npm install --save broid-<your-messaging-plateform>
-```
## Introduction
-Broid Integrations provide a suite of librairies to convert all messagings plateforms events to [Activity Streams 2](https://t.broid.ai/c/LSB12U?utm_source=github&utm_medium=readme&utm_campaign=introduction&link=as2) schemas.
+Broid Integrations provide a suite of libraries to convert all messaging platforms events to [Activity Streams 2](https://t.broid.ai/c/LSB12U?utm_source=github&utm_medium=readme&utm_campaign=introduction&link=as2) schemas.
**TL;DR**
-* All events are Observables (RxJS)
-* All functions return Promise (Bluebird)
-* Highly modular and low level to keep your focus on hight level features.
+* All events are Observables ([RxJS](https://github.com/ReactiveX/rxjs))
+* All functions return a Promise ([Bluebird](http://bluebirdjs.com/docs/getting-started.html))
+* Highly modular to keep your focus on high level features
+
+### Quick Example
+
+A quick example showing off listening for new messages on Facebook Messenger and Discord with Observables.
+
+```shell
+npm i --save broid-messenger broid-discord rxjs ramda
+```
+
+```javascript
+const Rx = require("rxjs/Rx");
+const R = require("ramda");
+const BroidDiscord = require("broid-discord");
+const BroidMessenger = require("broid-messenger");
+
+const clients = {
+ discord: new BroidDiscord({token: 'DISCORD_TOKEN'}),
+ messenger: new BroidMessenger({token: 'FACEBOOK_TOKEN', tokenSecret: 'FACEBOOK_SECRET'})
+};
+
+Rx.Observable.merge(...R.map(client => client.connect(), R.values(clients)))
+ .subscribe({
+ next: data => console.log(JSON.stringify(data, null, 2)),
+ error: err => console.error(`Something went wrong: ${err.message}`),
+ });
+```
### Get Started
-Check out Broid's quick [**Get Started**](https://t.broid.ai/c/MRAxh0?utm_source=github&utm_medium=readme&utm_campaign=get-started) guide.
+Check out Broid's quick [**Get Started**](https://t.broid.ai/c/MRAxh0?utm_source=github&utm_medium=readme&utm_campaign=get-started) guide to get a better feel of what Broid is capable of.
+
<a name="integrations"></a>
## Integrations
-Broid Integrations support simple, media and rich messages (location, carroussel) and split into multiple librairies.
-This make Broid **flexible** and **usefull** to use in your application.
+Broid Integrations support simple, media and rich messages (location, carroussel) and split into multiple libraries.
+This make Broid **flexible** and **useful** to use in your application.
#### Node packages
||Name|Status|
|:--|:--|:----|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-slack"><img width="35" src="https://t.broid.ai/i/s-slack-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-slack |[![viber][slack-npm]][slack-url] [![slack][slack-dm]][slack-dm-url] [![slack][integration-doc]][slack-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-viber"><img width="35" src="https://t.broid.ai/i/p-viber-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-viber |[![viber][viber-npm]][viber-url] [![viber][viber-dm]][viber-dm-url] [![viber][integration-doc]][viber-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-twitter"><img width="35" src="https://t.broid.ai/i/s-twitter-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-twitter |[![viber][twitter-npm]][twitter-url] [![twitter][twitter-dm]][twitter-dm-url] [![twitter][integration-doc]][twitter-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-line"><img width="35" src="https://t.broid.ai/i/p-line-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-line |[![line][line-npm]][line-url] [![line][line-dm]][line-dm-url] [![line][integration-doc]][line-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-messenger"><img width="35" src="https://t.broid.ai/i/s-messenger-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-messenger |[![messenger][messenger-npm]][messenger-url] [![messenger][messenger-dm]][messenger-dm-url] [![messenger][integration-doc]][messenger-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-alexa"><img width="35" src="https://t.broid.ai/i/p-alexa-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-alexa |[![alexa][alexa-npm]][alexa-url] [![alexa][alexa-dm]][alexa-dm-url] [![alexa][integration-doc]][alexa-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-callr"><img width="35" src="https://t.broid.ai/i/p-callr-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-callr |[![callr][callr-npm]][callr-url] [![callr][callr-dm]][callr-dm-url] [![callr][integration-doc]][callr-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-discord"><img width="35" src="https://t.broid.ai/i/s-discord-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-discord |[![discord][discord-npm]][discord-url] [![discord][discord-dm]][discord-dm-url] [![discord][integration-doc]][discord-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-skype"><img width="35" src="https://t.broid.ai/i/p-skype-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-skype |[![skype][skype-npm]][skype-url] [![skype][skype-dm]][skype-dm-url] [![skype][integration-doc]][skype-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-telegram"><img width="35" src="https://t.broid.ai/i/s-telegram-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-telegram |[![telegram][telegram-npm]][telegram-url] [![telegram][telegram-dm]][telegram-dm-url] [![telegram][integration-doc]][telegram-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-twilio"><img width="35" src="https://t.broid.ai/i/p-twilio-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-twilio |[![twilio][twilio-npm]][twilio-url] [![twilio][twilio-dm]][twilio-dm-url] [![twilio][integration-doc]][twilio-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-flowdock"><img width="35" src="https://t.broid.ai/i/s-flowdock-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-flowdock |[![flowdock][flowdock-npm]][flowdock-url] [![flowdock][flowdock-dm]][flowdock-dm-url] [![flowdock][integration-doc]][flowdock-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-kik"><img width="35" src="https://t.broid.ai/i/p-kik-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-kik |[![kik][kik-npm]][kik-url] [![kik][kik-dm]][kik-dm-url] [![kik][integration-doc]][kik-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-irc"><img width="35" src="https://t.broid.ai/i/p-irc-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-irc |[![irc][irc-npm]][irc-url] [![irc][irc-dm]][irc-dm-url] [![irc][integration-doc]][irc-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-gitter"><img width="35" src="https://t.broid.ai/i/p-gitter-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-gitter |[![gitter][gitter-npm]][gitter-url] [![gitter][gitter-dm]][gitter-dm-url] [![gitter][integration-doc]][gitter-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-google-assistant"><img width="35" src="https://t.broid.ai/i/p-google-assistant-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-google-assistant |[![google-assistant][google-assistant-npm]][google-assistant-url] [![google-assistant][google-assistant-dm]][google-assistant-dm-url] [![google-assistant][integration-doc]][google-assistant-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-nexmo"><img width="35" src="https://t.broid.ai/i/p-nexmo-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-nexmo |[![nexmo][nexmo-npm]][nexmo-url] [![nexmo][nexmo-dm]][nexmo-dm-url] [![nexmo][integration-doc]][nexmo-url]|
|<a href="https://github.com/broidHQ/integrations/tree/master/broid-groupme"><img width="35" src="https://t.broid.ai/i/p-groupme-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-groupme |[![groupme][groupme-npm]][groupme-url] [![groupme][groupme-dm]][groupme-dm-url] [![groupme][integration-doc]][groupme-url]|
-|<a href="https://github.com/broidHQ/integrations/tree/master/broid-alexa"><img width="35" src="https://t.broid.ai/i/p-alexa-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-alexa |[![alexa][alexa-npm]][alexa-url] [![alexa][alexa-dm]][alexa-dm-url] [![alexa][integration-doc]][alexa-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-irc"><img width="35" src="https://t.broid.ai/i/p-irc-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-irc |[![irc][irc-npm]][irc-url] [![irc][irc-dm]][irc-dm-url] [![irc][integration-doc]][irc-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-kik"><img width="35" src="https://t.broid.ai/i/p-kik-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-kik |[![kik][kik-npm]][kik-url] [![kik][kik-dm]][kik-dm-url] [![kik][integration-doc]][kik-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-line"><img width="35" src="https://t.broid.ai/i/p-line-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-line |[![line][line-npm]][line-url] [![line][line-dm]][line-dm-url] [![line][integration-doc]][line-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-messenger"><img width="35" src="https://t.broid.ai/i/s-messenger-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-messenger |[![messenger][messenger-npm]][messenger-url] [![messenger][messenger-dm]][messenger-dm-url] [![messenger][integration-doc]][messenger-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-nexmo"><img width="35" src="https://t.broid.ai/i/p-nexmo-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-nexmo |[![nexmo][nexmo-npm]][nexmo-url] [![nexmo][nexmo-dm]][nexmo-dm-url] [![nexmo][integration-doc]][nexmo-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-skype"><img width="35" src="https://t.broid.ai/i/p-skype-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-skype |[![skype][skype-npm]][skype-url] [![skype][skype-dm]][skype-dm-url] [![skype][integration-doc]][skype-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-slack"><img width="35" src="https://t.broid.ai/i/s-slack-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-slack |[![viber][slack-npm]][slack-url] [![slack][slack-dm]][slack-dm-url] [![slack][integration-doc]][slack-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-telegram"><img width="35" src="https://t.broid.ai/i/s-telegram-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-telegram |[![telegram][telegram-npm]][telegram-url] [![telegram][telegram-dm]][telegram-dm-url] [![telegram][integration-doc]][telegram-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-twilio"><img width="35" src="https://t.broid.ai/i/p-twilio-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-twilio |[![twilio][twilio-npm]][twilio-url] [![twilio][twilio-dm]][twilio-dm-url] [![twilio][integration-doc]][twilio-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-twitter"><img width="35" src="https://t.broid.ai/i/s-twitter-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-twitter |[![viber][twitter-npm]][twitter-url] [![twitter][twitter-dm]][twitter-dm-url] [![twitter][integration-doc]][twitter-url]|
+|<a href="https://github.com/broidHQ/integrations/tree/master/broid-viber"><img width="35" src="https://t.broid.ai/i/p-viber-color?utm_source=github&utm_medium=readme&utm_campaign=integrations"></a>| broid-viber |[![viber][viber-npm]][viber-url] [![viber][viber-dm]][viber-dm-url] [![viber][integration-doc]][viber-url]|
[integration-doc]: https://img.shields.io/badge/docs--green.svg?style=flat
@@ -176,10 +198,7 @@ Broid integrations supports [Activity Streams 2.0](https://t.broid.ai/c/LSB12U?u
## Contributing
-If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.
-
-If you create a integrations, please consider open sourcing it, putting it
-on npm, following the `broid-<xxxx>` convention as a name and create an issue on Github to inform the community.
+If you have discovered a bug or have a feature suggestion, feel free to create an issue. If you create a integration, feel free to open a Pull Request!
You are also welcome to correct any spelling mistakes or any language issues.
@@ -191,7 +210,6 @@ Make sure that you're read and understand the [Code of Conduct](http://contribut
### CLA
-
To protect the interests of the Broid contributors, Broid, customers and end users we require contributors to sign a [Contributors License Agreement](https://cla-assistant.io/broidhq/integrations) (CLA) before we pull the changes into the main repository. [Our CLA](https://cla-assistant.io/broidhq/integrations) is simple and straightforward - it requires that the contributions you make to any Broid open source project are properly licensed and that you have the legal authority to make those changes. This helps us significantly reduce future legal risk for everyone involved. It's easy---no faxing or printing required!
You can digitally sign the [CLA online](https://cla-assistant.io/broidhq/integrations). Please indicate your email address in your first pull request so that we can make sure that will locate your CLA. Once you've submitted it, you no longer need to send one for subsequent submissions.
@@ -201,6 +219,7 @@ You can digitally sign the [CLA online](https://cla-assistant.io/broidhq/integra
[![Broid contributors](https://img.shields.io/badge/Broid%20contributors%20-broidy-%23FF0000.svg?style=flat)](https://github.com/broidy)
[![Broid contributors](https://img.shields.io/badge/Broid%20contributors%20-killix-%23FF0000.svg?style=flat)](https://github.com/killix)
+[![Broid contributors](https://img.shields.io/badge/Broid%20contributors%20-dustinblackman-%23FF0000.svg?style=flat)](https://github.com/dustinblackman)
[npm]: https://img.shields.io/badge/npm-broid-green.svg?style=flat
[npm-url]: https://www.npmjs.com/~broid
View
@@ -16,9 +16,9 @@ Broid Integrations is an open source project providing a suite of Activity Strea
## Message types supported
-| Simple | Image | Video | Buttons | Location | Phone number |
-|:--------:|:--------:|:------:|:--------:|:---------:|:------------:|
-| | ✅ | ✅ | | | |
+| Simple | Image | Video | Buttons | Location | Phone number |
+|:------:|:-----:|:-----:|:-------:|:--------:|:------------:|
+| | ✅ | ✅ | | | |
_Buttons, Location, Phone number are platform limitations._
@@ -35,24 +35,24 @@ npm install --save broid-alexa
### Connect to Alexa
```javascript
-import broidAlexa from 'broid-alexa'
+const BroidAlexa = require('broid-alexa');
-const alexa = new broidAlexa({
+const alexa = new BroidAlexa({
http: {
port: 8080,
host: "0.0.0.0"
}
-})
+});
alexa.connect()
.subscribe({
next: data => console.log(data),
error: err => console.error(`Something went wrong: ${err.message}`),
complete: () => console.log('complete'),
- })
+ });
```
-**Options availables**
+**Options available**
| name | Type | default | Description |
| --------------- |:--------:| :--------: | --------------------------|
@@ -73,14 +73,30 @@ alexa.listen()
### Post a message
-To send a message, the format should use the [broid-schemas](https://github.com/broidhq/broid-schemas).
+To send a message, the format should use [broid-schemas](https://github.com/broidHQ/integrations/tree/master/broid-schemas).
```javascript
-const message_formated = '...'
+const formatted_message = {
+ "@context": "https://www.w3.org/ns/activitystreams",
+ "type": "Create",
+ "generator": {
+ "id": "f6e92eb6-f69e-4eae-8158-06613461cf3a",
+ "type": "Service",
+ "name": "alexa"
+ },
+ "object": {
+ "type": "Note",
+ "content": "What's the weather like today?"
+ },
+ "to": {
+ "id": "15146345659",
+ "type": "Person"
+ }
+}
-alexa.send(message_formated)
+alexa.send(formatted_message)
.then(() => console.log("ok"))
- .catch(err => console.error(err))
+ .catch(err => console.error(err));
```
## Examples of messages
View
@@ -16,9 +16,9 @@ Broid Integrations is an open source project providing a suite of Activity Strea
## Message types supported
-| Simple | Image | Video | Buttons | Location | Phone number |
-|:--------:|:--------:|:------:|:--------:|:---------:|:------------:|
-| | ✅ | ✅ | | | |
+| Simple | Image | Video | Buttons | Location | Phone number |
+|:------:|:-----:|:-----:|:-------:|:--------:|:------------:|
+| | ✅ | ✅ | | | |
_Buttons, Location, Phone number are platform limitations._
@@ -27,7 +27,7 @@ _Buttons, Location, Phone number are platform limitations._
### Connect to Callr
```javascript
-import broidCallr from 'broid-callr'
+const BroidCallr = require('broid-callr');
const callr = new broidCallr({
username: '<sender_name>',
@@ -36,17 +36,17 @@ const callr = new broidCallr({
http: {
webhookURL: "http://127.0.0.1/"
}
-})
+});
callr.connect()
.subscribe({
next: data => console.log(data),
error: err => console.error(`Something went wrong: ${err.message}`),
complete: () => console.log('complete'),
- })
+ });
```
-**Options availables**
+**Options available**
| name | Type | default | Description |
| ---------------- |:--------:| :--------: | --------------------------|
@@ -73,9 +73,25 @@ callr.listen()
To send a message, the format should use the [broid-schemas](https://github.com/broidHQ/integrations/tree/master/integrations/broid-schemas).
```javascript
-const message_formated = '...'
+const formatted_message = {
+ "@context": "https://www.w3.org/ns/activitystreams",
+ "type": "Create",
+ "generator": {
+ "id": "f6e92eb6-f69e-4eae-8158-06613461cf3a",
+ "type": "Service",
+ "name": "callr"
+ },
+ "object": {
+ "type": "Note",
+ "content": "hello world"
+ },
+ "to": {
+ "type": "Person",
+ "id": "+15437783737"
+ }
+};
-callr.send(message_formated)
+callr.send(formatted_message)
.then(() => console.log("ok"))
.catch(err => console.error(err))
```
Oops, something went wrong.

0 comments on commit 79b357f

Please sign in to comment.