npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-chatter

v0.0.2

Published

This is adapter for hubot.

Downloads

5

Readme

Hubot Chatter Adapter

Build Status

Description

This is Chatter adapter for hubot.

Installation and Setup

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

Usage

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

HUBOT_SFDC_USERNAME

This is the username for your chatter bot.

HUBOT_SFDC_PASSWORD

This is the password for your chatter bot.

HUBOT_SFDC_LOGINURL

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.

HUBOT_SFDC_API_VERSION

This is the salesforce API version.
If not specified, this value defaults to "30.0".

HUBOT_SFDC_QUERY_OBJECT

This is the chatter object which you want to monitor and post.

HUBOT_SFDC_POLLING_TYPE

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".

HUBOT_SFDC_TOPIC

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').

HUBOT_SFDC_PARENT_ID

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).

HUBOT_SFDC_POLLING_INTERVAL

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).

StreamingAPI

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.

Sample

Using SOQL polling

export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga

Using StreamingAPI

export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_POLLINGTYPE=streaming
export HUBOT_SFDC_TOPIC=AllMessages

Connect to Sandbox with setting to 5minutes for polling interval

export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_LOGINURL=https://test.salesforce.com
export HUBOT_SFDC_POLLING_INTERVAL=300000

Monitoring and Posting FeedComment Object

export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_QUERY_OBJECT=FeedComment

Monitoring and Posting The Record/Group Feed

export [email protected]
export HUBOT_SFDC_PASSWORD=hogefuga
export HUBOT_SFDC_PARENT_ID=001A0000019n4FhIAI #Account Feed
#export HUBOT_SFDC_PARENT_ID=0F9A0000000HZKUKA4 #Group Feed

Contribute

Just send pull request if needed or fill an issue!

License

The MIT License See LICENSE file.