Integrating Facebook likes into SAC
In my previous blog, I was explaining the way to integrate Live Twitter Tweets into SAC.
In this blog, I would like to share the steps involved to integrate and explore the Facebook “Likes” into SAP Analytics Cloud(SAC).
Here the workflow is getting the Facebook Likes into SAP HANA via Data Provisioning Agent and exposing them through the BW Open ODS View to SAC.
The following diagram, explains the architecture of the same.
We created a Facebook Application through https://developers.facebook.com which holds the information about,
The Access Token is valid for an Hour, but you can regenerate it again from the Facebook App created.
The following two files have to be placed under the lib folder of DP Agent
The Adapter.xml resides under C:\usr\sap\dataprovagent\camel has to be updated with the Facebook Adapter details. This is the location where the DP Agent installed.
These information are given to the Remote Source created under SAP HANA Web based Development Workbench(This workbench can be accessed through http://HANAServer :80<instance no>/sap/hana/ide/catalog/)
Once the Remote Source created, the tables would be listed under that.
Create a New Virtual Table which will create an entry under your schema->Tables.
Opening the content of the table, lists the Television programs the user liked in Facebook
The following blog explains, how this can be achieved.
Once the Facebook Likes are into HANA, you can expose this as a native HANA View(Analytics/Calc View) or via BW (through Open ODS View or so) to SAC.
To get the Live data, a Live Connection can be created in SAC to HANA directly or to the BW on HANA system(if the data exposed via Open ODS View).
Getting Live data involves configuring CORS(Cross Origin Resource Sharing) in the backend(either HANA or BW).You can refer the SAC Help document about these CORS configurations.
In this example, I have a BW on HANA system, where the Facebook Likes(which resides on HANA table) are exposed via Open ODS View to the SAC.
The steps involved here are,
- Make sure that the Likes are stored in the HANA table
- In SAP HANA Studio, go to the BW Modelling perspective, and create an InfoArea
- Create an Open ODS View on top of the HANA Data source
- Create a Composite Provider on top of the Open ODS View
- Create a BEx Query on top of a Composite Provider
- Create an Import Connection to the BW on HANA system, in SAC (You need the Cloud Connector and Cloud Agent configured. For more details on this, you can find SAC Help document)
- Using this connection, create a Model and then the Story on top of it
Steps 2,3 and 4 can be done with BW Modelling perspective of HANA Studio
Step 5, needs BEx Query Designer
Steps 6 and 7 need to be done in SAC
Since we are using the Import type Connection, you can schedule the Data import every hr or so, to get the latest data Or you can also trigger import just by clicking the “Update Model Now” option in the Data Model->Data Sources tab
Once you refresh the Story, the Facebook Likes would be shown in SAC.
Hope you would have found this topic interesting and thanks for reading it.
Please feel free to leave your Comments/Feedbacks.