This is Chatter adapter for hubot.
1. Add hubot-chatter to dependencies in your hubot's package.json.
"dependencies": {
"hubot-chatter": "0.0.2",
"hubot": "~2.8.2"
}
2. Install hubot-chatter
npm install
3. Set environment variables.
export HUBOT_SFDC_USERNAME="input hubot user's username"
export HUBOT_SFDC_PASSWORD="input hubot user's password"
4. Run hubot with chatter adapter.
bin/hubot -a chatter
The chatter adapter requires only the following environment variables.
- HUBOT_SFDC_USERNAME
- HUBOT_SFDC_PASSWORD
And the following are optional.
- HUBOT_SFDC_LOGINURL
- HUBOT_SFDC_API_VERSION
- HUBOT_SFDC_QUERY_OBJECT
- HUBOT_SFDC_POLLING_TYPE
- HUBOT_SFDC_TOPIC
- HUBOT_SFDC_POLLING_INTERVAL
- HUBOT_SFDC_PARENT_ID
This is the username for your chatter bot.
This is the password for your chatter bot.
This is the salesforce login server URL(e.g. 'https://login.salesforce.com/')
If not specified, this value defaults to "https://login.salesforce.com".
Set to "https://test.salesforce.com", when you want your hubot to connect to sandbox.
This is the salesforce API version.
If not specified, this value defaults to "30.0".
This is the chatter object which you want to monitor and post.
This is the method for monitoring chatter objects.
Set to "streaming", when you want to use StreamingAPI to monitor chatter objects.
Set to "query", when you want to use SOQL and polling to monitor chatter objects.
If not specified, this value defaults to "query".
This is the topic name to subscribe for StreamingAPI.
Set to the target topic name, when you want to use StreamingAPI (HUBOT_SFDC_POLLING_TYPE='streaming').
This is the parent ID which your hubot moniters and posts feeds to(e.g. Chatter Group ID).
If not specified, your hubot monitors and posts feeds to user account(refered by HUBOT_SFDC_USERNAME).
This is the number of milliseconds to wait between attempts when polling for results of the query result.
If not specified, this value defaults to 60,000(1min).
If you want to use StreamingAPI for monitoring chatter feeds, Please implement 4 custom text fields for target Object. These fields mean following below.
- User__c: Salesforce UserId.
- ParentId__c: Related User/Group/Record ID.
- Body__c: Message Body.
- FeedItemId__c: Parent FeedItem ID.
export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_POLLINGTYPE=streaming
export HUBOT_SFDC_TOPIC=AllMessages
export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_LOGINURL=https://test.salesforce.com
export HUBOT_SFDC_POLLING_INTERVAL=300000
export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_QUERY_OBJECT=FeedComment
export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_PARENT_ID=001A0000019n4FhIAI #Account Feed
#export HUBOT_SFDC_PARENT_ID=0F9A0000000HZKUKA4 #Group Feed
Just send pull request if needed or fill an issue!
The MIT License See LICENSE file.