Sourcebot: Setting up and Configuring Sourcebot
Before setting up Sourcebot you first want to make sure you have a few prerequisites set up.
Prerequisites
1. Create Github account to hold your own copy of Sourcebot
2. Create a Heroku Account to host your instance of Sourcebot on
3. You need a WordPress blog/newsite and install ElasticPress a WordPress Plugin
4. Facebook Developers Account
Once you have these set up you should visit
https://github.com/EuropeanJournalismCentre/Sourcebot
and click the fork button to create a copy of sourcebot in your account
Once you’ve forked the project you want to click the Deploy button to begin the setup process
Click the deploy button will open a app setup page.
Once the page loads give your Bot a name and select a region where your application is hosted
e.g.
Next configure the environment variables
To configure the environment variables shown above:
1. Enter the name of your bot.
2. Visit https://developers.facebook.com/ create a new app, select Messenger under Add a Product
In the messenger platform setup select Token Generation
Select the Facebook page you want to provision your bot under and wait for it to generate an access token.
Copy the Page Access Token and add to the config variable of the same name.
Next you have to set the VERIFY_TOKEN configure variable you will use the same VERIFY_TOKEN string to set up a webhook once the app is deplooyed.
Set the WEBSITE_URL to the address of your WordPress site.
And finally copy the link to your page’s profile picture to PROFILE_PIC_URL and click deploy.
Once the application and all its add-ons are created as shown below in the application overview
Click on SendGrid to set up its API key and add it to the configure variables
You will now configure you BONSAI_URL variable by clicking on the Bonsai Elasticsearch add-on and copying the FULL-ACCESS Url
Setup Elasticpress on your WordPress site and copy the Bonsai_Url to Elasticpress as the host link to make sure both the application and Elasticpress are point to the same Elasticsearch cluster.
Get the link to your Heroku application from the application settings and create a webhook on https://developers.facebook.com/ along with the Verify Token you saved earlier.
As a final setup step copy the link you get from Heroku paste it in the address bar end that link with /config/setup.php
e.g. https://testbot.herokuapp.com/ -> https://testbot.herokuapp.com/config/setup.php
Click enter and wait until you see the done message the close the page.
Now open the admin dashboard on /portal
e.g. https://testbot.herokuapp.com/ -> https://testbot.herokuapp.com/portal/
You should now have an login for the Admin Dashboard
To login use the email admin@sourcebot.com and password NewBot123
(p.s. change these credentials A.S.A.P using the dashboard)
And voilà you’ve set up a news chat bot on Heroku no coding required using Sourcebot!