A simple slack bot that will keep track of tweets and post to a room
Перейти к файлу
Wade Wegner 272aaa4c63 Not posting badges 2017-07-11 10:50:23 -07:00
assets Fixes and intent service integration 2017-07-08 09:44:55 -07:00
lib Updated formatting 2017-07-08 16:14:46 -07:00
scripts Lots of improvements, including replies with details 2017-07-08 15:51:03 -07:00
.eslintrc Better error logging 2017-07-08 11:09:42 -07:00
.gitignore Initial working sample 2017-05-16 19:25:11 -07:00
.jshintrc Refactoring 2017-05-16 20:12:52 -07:00
LICENSE Initial commit 2017-05-16 20:11:02 -07:00
Procfile Wrong procfile type 2017-05-16 19:47:14 -07:00
README.md Updated README 2017-07-06 11:38:16 -05:00
index.js Not posting badges 2017-07-11 10:50:23 -07:00
package.json Adding Einstein sentiment 2017-07-05 16:51:45 -05:00

README.md

slack-twitter-bot

A simple slack bot that will keep track of tweets and post to a room. It also uses the Einstein Sentiment API to determine if it's positive, negative, or neutral. It's designed to run in Heroku.

You'll want to setup the following environment variables for this to work (this is formatted for VS Code "env"):

"DATABASE_URL": "",
"SLACKTOKEN": "",
"SLACKNAME": "SFDX Bot",
"CONSUMERKEY": "",
"CONSUMERSECRET": "",
"ACCESSTOKEN": "",
"ACCESSTOKENSECRET": "",
"SEARCHTERMS": "#SalesforceDX OR #SFDX OR SalesforceDX OR SFDX",
"SEARCHRESULTCOUNT": 1,
"LOOPINTERVAL": "2",
"LOCAL": "",
"EINSTEIN_VISION_PRIVATE_KEY": "",
"EINSTEIN_VISION_ACCOUNT_ID": ""

As you can see, I'm using a Heroku worker and a Postgres database. Run this script to create it:

CREATE TABLE posted_tweets(
   id integer,
   url text,
   created_at timestamp SET DEFAULT now(),
   id_str text,
   PRIMARY KEY( id )
);

CREATE UNIQUE INDEX posted_tweets_pkey ON posted_tweets USING btree (id)
CREATE UNIQUE INDEX posted_tweets_url_key ON posted_tweets USING btree (url)

That's pretty much it! Simple, simple.