Helm integration with Facebook

Helm 4.4 includes a Facebook “device” to allow Helm panels to integrate use of Facebook with broadcast devices.

Typical application include:

  • Posting status updates directly to Facebook from Helm panels
  • Creating Facebook Live streaming broadcasts directly from Helm
  • Integrating encoder control with Live streaming.
  • Continuous monitoring of audience figures and “likes” for content

The Facebook device icon

You’ll start by placing a Facebook device icon on your panel. It’s found in the parts bin under “Broadcast devices/Other”

Application ID

Every third-party application that uses the Facebook API has an Application ID which identifies it. When you first place a Facebook icon, the AppID is set to an application called “Helm Live” which is administered by Rascular. If necessary, you can replace this with your own Application ID by registering as a Facebook developer and ‘creating’ your own App. This will allow you to manage users and statistics of your app independently of Rascular.

Facebook apps which can publish content to Facebook to go through a review process before they are publicly available. Because the “Helm Live” app has not done that yet, please contact us to request access to the application as a “Tester”.

When using Helm Web Panels, the integration with Facebook is very different. Because of this you will almost certainly need to register your own Application ID and associate it with the domain name (or internal IP address) where you will host the Rascular WebCentre software.

Permissions

When an App asks you to log in to Facebook it can request a wide range of permissions, including the ability to publish content to your feed.  You can configure the requested permissions via the “permissions” property.  Commonly used permissions include “publish_actions” for posting content to a user’s feed, “manage_pages” and “publish_pages” for viewing and managing content on other pages that the logged-in user can control.

Logging in

Before performing any action your Helm panel must log in to Facebook. Use the script action “Login” for this.

–lua

H.FACEBOOK_1.Login()

When this script runs, the panel will show a sequence of Facebook login dialogs, depending on the permissions requested. These dialogs are all web pages served directly from Facebook.

Login credentials may be cached by the browser (Internet Explorer) so you may not be prompted for password, etc after the first time. Once logged in, the properties “User” and “LoggedIn” of the Facebook device will be updated

Sending and retrieving data from Facebook.

Helm panels can access the full capabilities of the Facebook Graph API, using just three functions: Post, Get and Delete. The first parameter for each of these is the node or edge endpoint. Helm automatically adds the base facebook URL (“https://graph.facebook.com”) so just the or name of the endpoint is needed.

--lua

local me = H.FACEBOOK_1.Get("me")
print(me.name)  -- prints user name to debug window.

Query parameters needed for the operation are passed as a table via the second parameter, if needed. Any data from Facebook is returned as a table by the functions.

Example, specifying that we want the user’s gender.

--lua

local params = {fields="gender"}
print(H.FACEBOOK_1.Get("me", params).gender)  -- prints user gender to debug window.

Here’s a example posting a status update to the user’s feed from Lua.

H.FACEBOOK_1.Post("me/feed", "I'm feeling happy!")

Access Tokens

An access token is a code returned from Facebook that allows an app to perform certain requests. Some operations (e.g. those on Pages) require a special “page” access token. When no access token is specified in the query parameters, Helm will provide the ‘user’ access token given by facebook when the login completed. Scripts can add their own access token (normally extracted from a reply to a previous Facebook ‘get’ request) via the access_token query parameter.

Debugging Facebook requests.

The Facebook API is large and complex, but there are lots of resources available on the Web to help. One free tool that we’ve found invaluable is Fiddler from Telerik. This application allows you to inspect the encrypted comms between Facebook and Helm, to see the requests and responses directly.

Fiddler acts as a Web Proxy, and to use it Helm must redirect HTTPS traffic via the proxy. Helm’s Facebook connection properties allow proxy configuration for this.