This service receives your messages from Sentisis Connect and boost the Tweets before forwarding them to your webhook.
In order to abide by Twitter's usage terms, Séntisis is not allowed to share Twitter data with third parties. By using this service with your own credentials you will be able to get all that Séntisis offers (sentiment analysis, categorization...) while seamlessly keeping data from Twitter.
- Docker-ready: setup everything with just a command!
- Bulk lookup: to prevent hitting Twitter API's rate limits
- Highly configurable: to fit everybody's needs
- Resilient: it will retry failed requests several times before giving up
For a POST
request to /
(or any other path actually) the input should have this format:
{
id: String, // Séntisis id
msgId: String, // Twitter id
type: String, // Tweet | ReTweet | FacebookPost | FacebookComment | InstagramPost | InstagramComment | YoutubeVideo | YoutubeComment
sentiment: String, // POSITIVE | NEGATIVE | OBJECTIVE
categories: [
{
id: String,
name: String,
}
],
feed: {
id: String,
name: String,
},
user: {
gender: String, // MALE | FEMALE | UNKNOWN
location: {
country: String,
region: String,
},
}
}
And send this to the webhook:
{
id: String, // Séntisis id
msgId: String, // Twitter id
type: String, // Tweet | ReTweet | FacebookPost | FacebookComment | InstagramPost | InstagramComment | YoutubeVideo | YoutubeComment
sentiment: String, // POSITIVE | NEGATIVE | OBJECTIVE
categories: [
{
id: String,
name: String,
}
],
feed: {
id: String,
name: String,
},
user: {
gender: String, // MALE | FEMALE | UNKNOWN
location: {
country: String,
region: String,
},
username: String,
id: String, // Twitter id
name: String,
followers: Number,
friends: Number,
},
link: String,
text: String,
date: String, // ISO-8601
}
Your server should:
- Have docker installed
- Have access to your webhook URL
- Have access to the internet in order to interact with Twitter's API
Make sure you meet all the previously mentioned requirements. Say your webhook address is http://webhook.my-company.com/sentisis
and you want to make the service available at port 3000. Run this command with your settings to start the service:
$ docker run -e FORWARD_URL=http://webhook.my-company.com/sentisis -e PORT=3000\
-e TW_CONSUMER_KEY=<YOUR_CONSUMER_KEY> -e TW_CONSUMER_SECRET=<YOUR_CONSUMER_SECRET> \
-e TW_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> -e TW_ACCESS_TOKEN_SECRET=<YOUR_ACCESS_TOKEN_SECRET> \
-p 3000:3000 --name connect-booster -d --restart always sentisis/connect-booster:1.0.0
If everything went fine, the service is now ready to receive POST
requests with messages from Séntisis (json).
You can either check the logs or hit /healthcheck
from outside your network.
Key | Required | Default | Description |
---|---|---|---|
FORWARD_URL |
yes | - | Fully qualified URL of the webhook |
TW_CONSUMER_KEY |
yes | - | Your Twitter account's consumer key |
TW_CONSUMER_SECRET |
yes | - | Your Twitter account's consumer secret |
TW_ACCESS_TOKEN |
yes | - | Your Twitter account's access token |
TW_ACCESS_TOKEN_SECRET |
yes | - | Your Twitter account's access token secret |
TW_BUFFER_SIZE |
no | 10 | Maximum amount of tweets to ask the Twitter's API for at once |
TW_BUFFER_INTERVAL |
no | 10000 | Interval to flush (process) all accumulated tweets. In miliseconds |
DISCARD_NOT_ENRICHED |
no | false | Whether to discard or forward failed messages (tweets that were not enriched due to i.e. an error on Twitter's API) |
PORT |
no | 8080 | HTTP port for the service to listen to |
Check the project's dockerhub
$ FORWARD_URL=http://localhost:5555 \
TW_CONSUMER_KEY=<YOUR_CONSUMER_KEY> TW_CONSUMER_SECRET=<YOUR_CONSUMER_SECRET> \
TW_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> TW_ACCESS_TOKEN_SECRET=<YOUR_ACCESS_TOKEN_SECRET> \
yarn start
$ yarn test