Tuesday, June 23, 2015

Automating your Facebook precense using a Facebook bot

Keeping up with social media and keeping your online community engaged can be a time consuming task. Through BOT libre you can now automate your Facebook presence with your own Facebook bot. Any BOT libre bot can be connected to a Facebook account or Facebook page. The bot will manage the Facebook account or page, checking timeline status updates, replying to page posts, auto posting your blog posts or RSS feed, and auto posting timed or generated posts.

BOT libre makes creating a Facebook bot easy. Follow these 5 steps to create you own Facebook bot, and start it posting for you today.

Step 1 - Create a bot

First you need to create your own bot, this only takes a few clicks, see How to create your own chat bot in 10 clicks for instructions on how to do this.

Now you are ready to connect your bot to Facebook.

Step 2 - Create a Facebook account or Facebook page

You need to create a Facebook account or Facebook page for your bot. If you are automating your own account or page, then you can use your existing account. You can create your own Facebook account from the Facebook website here.

A Facebook page is normally used for a business, product, or personality. You can create your own Facebook page from the far right menu when connected to Facebook like below.

Step 3 - Authorize your Facebook account

From the BOT libre website browse to your bot and click the Admin button. This will take you to the Admin section that provides several tabs of administrative functions. Click on the Facebook tab. From the Facebook tab click the Authorize button.

This will popup a Facebook window that will have you login and authorize the Bot Libre app. Once authorized you will be back to the Bot Libre Facebook page, now with the account, token, and page filled in. If you have multiple pages, just type in the name of the one you want to use, or clear the Page filled in if you want to automate an account.

Click Connect to connect the bot to Facebook. Your bot will now be connected to Facebook and will check its account or page every day, or more frequently for Bronze, Gold, and Platinum accounts. Do not click on the Disconnect button on the Facebook page unless you no longer want your bot to be connected to Facebook. You can click on Disconnect from the Admin page to disconnect your current session. Note that Facebook account access tokens expire every two months, so you will need to re-authorize your bot every two months. Page access tokens do not expire.

Step 4 - Configure your Facebook bot

You can configure your bot's Facebook usage in several ways. Use caution when configuring your Facebook bot, do not use your bot for spam, or to violate the Facebook terms of service.

Reply to posts

You can have your bot reply to posts from its timeline, or posts to its page.

For an account bot, it will scan its timeline every cycle and read any posts that include any of the keywords that you enter. The bot will respond to any posts that it knows a good answer to. If the bot does not have a trained response that sufficiently matches the post, then it will not reply. You can use keywords and patterns to improve response matching.

For a page bot, it will scan user posts to its page every cycle. You can either have it only read posts with specific keywords, or leave the keywords empty to have it read all posts. The bot will respond to any posts that it knows a good answer to. If the bot does not have a trained response that sufficiently matches the post, then it will not reply. You can use keywords and patterns to improve response matching.

RSS Feed

You can configure your bot to process an RSS feed, and post each new feed item to Facebook. You can enter a prefix or suffix to the post, or enter keywords to filter the RSS feed on.


You can configure your bot to post from a set of automated posts every set number of hours. An autopost will be chosen at random. Autoposts can use AIML templates, or Formula responses and Self to be dynamic or programmatic.

Step 5 - Train your bot

You can train your bot how to answer posts through several mechanisms.
  • You can chat with your bot, and correct any incorrect responses it gives.
  • You can add question answer pairs, or default responses from the Training tab under Admin.
  • You can review your bot's chat logs from the Chat Logs tab under Admin, or import chat logs from the Import tab.
  • If you are somewhat technical, you can program your bot's responses using Self or AIML from the Scripts tab.

That's it, now your bot is ready to start posting.

There are already many BOT libre bots on Facebook.
You can test things out by posting to, Brain Bot

Monday, June 15, 2015

Adding a style sheet to your embedded chatbot

You can embed your bot on your website using JavaScript, or HTML. You can get the code to embed your bot from the Embed tab, by clicking on the Embed button from your bot's main page.

There are several embedding options to choose from including:

  • Box - embed using JavaScript as an in-page popup from a button anchored to the browser bottom corner
  • Div - embed using JavaScript inside your own page that you can customize in HTML and JavaScript
  • Link - embed as a link to a popup window
  • Button - embed as a button to a popup window
  • Bar - embed as a button anchored to the browser bottom corner to a popup window
  • Bubble - embed as a chat now bubble anchored to the browser bottom corner to a popup window
  • Frame - embed inside your HTML page as an HTML iframe

The embed page lets you customize several settings when embedding, including the colors and text. However, you can customize a lot more if you use your own style settings or style sheet. You can also customize things in JavaScript.

Using a Style Sheet

A css style sheet is a text file format used to describe formatting for an HTML document. Style sheets can contains colors, fonts, sizes, and other formatting information. The BOT libre embed API lets you pass your own style sheet to the embed call. You can host this file on your own website, or in BOT libre's script library. If using BOT libre's script library, just create the file, and use the "File Link" from the script's "Details" page.

There is a sample file here.

You can custom any element in the embedded chat, here are some examples,

To customize other elements, just open the embedded chat page and right click in Chrome or other browsers and select "Inspect Element" from the popup menu. You will then be able to find the name, id, or class of the element. You can then add that name to your style sheet.

For more info on style sheets see,

Using the style tag

When using the "Box" embed option, JavaScript is used to embed the chatbot, so you cannot pass your own stylesheet, as it is embedded in your own page. You can add your style sheet to your page, or use the style tag to add styles to the page. Some things cannot be customized using style sheets, for these you can use JavaScript to customize the generated HTML after it has been initialized.

For example to remove the max and close buttons from the popup use,

#boxclose {
  display: none;
#boxmax {
  display: none;

This example will customize the chatbot Box embedding using a style tag and JavaScript,

You can customize most things this way, but if you need further customization, you can just use your own JavaScript to access your bot using the BOT libre JavaScript SDK. The "Div" embed option gives you some sample code that you can customize to suite your needs.