Facebook and Pentaho Data Integration
Step 2: Follow Instructions to setup your unique username
Add your own – or accept the defaults.
Step 3: Create a Facebook Application
http://www.facebook.com/developers/createapp.php
Allow “Developer” access to your basic information.
After you allow access to the Developer App – go back here: https://www.facebook.com/developers/createapp.php if it does not redirect you.
Create Application
Security Check
Verify Information
Click Web Site
Note your application ID and Application Secret
Examples:
Application ID: xxxxxxxxxxxxxxx
Application Secret: yyyyyyyyyyyyyyyyyyyyy
Enter your Site URL and Site Domain, this can be pretty much anything, but attempt to use your real information if available.
Note Settings, App ID, API Key and App Secret
Below summarizes those steps:
Step 4: Obtain Permanent OAUTH Access Token:
Create and execute the below URL in your browser: Modify the below URL to use your client_id and redirect_uri – see notes in blog post link above set permission values accordingly. (http://developers.facebook.com/docs/authentication/permissions/)
Your client_id is your App ID and the redirect_uri can be anything.
Sample URL:
https://graph.facebook.com/oauth/authorize?client_id=…&redirect_uri=http://wordsofthefamily.com/&scope=read_insights,
offline_access,publish_stream,create_event
Constructed URL:
https://graph.facebook.com/oauth/authorize?client_id=xxxxxxxxxxxxxx&redirect_uri=http://wordsofthefamily.com/&scope=read_insights,offline_access, publish_stream,create_event,rsvp_event,sms,publish_checkins,manage_friendlists,
read_stream,read_requests,user_status,user_about_me
You will get the following screen – yours might be different depending on what permissions you selected – make sure at least that “Post to my Wall” is there. If not verify your permissions based of off the permission link in the blog post.
Click Allow:
Now note the URL that was created in the browser address bar and that you were redirected to your page that you placed in the redirect_url.
You need the code value.
The code parameter will be a very lengthy string of random characters. Copy this value and hang on to it for the construction of a new URL.
This URL will turn the generated code into a valid access token for your application.
Sample of what is returned:
http://wordsofthefamily.com/?code=fdfdfdfdfdfeereghyjj.eyJpdiI6IjczU2YwUVJmaUJocXJjM1plOUdzVVEifQ.psncSCrwu-1659AZCHd7UBpUdBYdKCmvwXSu2-WxLcxfRt6wtwKzcjYkblwshjbnRX0EhcSrbG_U83AOv9pDrfomcLB8SY3gH1VW083oM997NqM28czfeaWpd8uv6sjECODE Example: fdfdfdfdfrert-8Qoj7wFkUqoCKWSEk89aCwd2zM.eyJpdiI6IjczU2YwUVJmaUJocXJjM1plOUdzVVEifQ.psncSCrwu-1659AZCHd7UBpUdBYdKCmvwXSu2-WxLcxfRt6wtwKzcjYkblwshjbnRX0EhcSrbG_U83AOv9pDrfomcLB8SY3gH1VW083oM997NqM28czfxxxrrer
Now Create the Following:
https://graph.facebook.com/oauth/access_token?client_id=...&client_secret=...&redirect_uri=http://liquid9.tv/&code=...
Fill in your application ID, application secret, redirect uri, and the code we just copied. Again, ours looks like this:
Constructed:
https://graph.facebook.com/oauth/access_token?client_id=xxxxxxxxx&client_secret=yyyyyyyyyyyyyyy&redirect_uri=http://wordsofthefamily.com/&code=xxxxxxxxxxx9_A-8Qoj7wFkUqoCKWSEk89aCwd2zM.eyJpdiI6IjczU2YwUVJmaUJocXJjM1plOUdzVVEifQ.psncSCrwu-1659AZCHd7UBpUdBYdKCmvwXSu2-WxLcxfRt6wtwKzcjYkblwshjbnRX0EhcSrbG_U83AOv9pDrfomcLB8SY3gH1VW083oM997NqM2xxxxxxxxxx
You will get back an access token:
access_token=1111111332444877557776746ghhg758d8f970bd1cbc17.1-100002640151006|d9WWkjxODcel0ZVIZfMEv5YKc10
Now you should be able to use PDI and the HTTP POST step using the various Facebook GRAPH APIs to do things: http://developers.facebook.com/docs/reference/api/ such as posting content to the Facebook wall / news feed and etc.
Step 5: Created a PDI Transformation using the HTTP POST step and the Facebook Graph API with /PROFILE_ID/feed
- Create a new Transformation
- Use a Generate Rows Step (found under Input) to set the various Facebook parameter names that can be found here
- http://developers.facebook.com/docs/reference/api/post/
-
Make sure to use the access_token parameter and value you got from the steps above
-
Add HTTP Post step (found under Lookup) and connect hop from Generate Rows
- Configure the HTTP Post step to use the feed RESTful service https://graph.facebook.com/mpentaho/feed
- Refer to http://developers.facebook.com/docs/reference/api/ Publishing section for list of methods
- Replace mpentaho with your unique user name you set up earlier
-
Jump to the Fields tab and click “Get Fields” under the “Query parameter” panel
-
Click OK, Save and right click on the HTTP Post Step and select Preview, then Quick Launch
- In a few seconds a panel should come up displaying your data
- Check the result column (at the end) and look for a return code such as:
- Example: {“id”:”100002640151006_100565053374833″}
- Check your newly created Facebook account wall and you should see your post Fig. 1
- If not check your Facebook account security and application privacy settings to ensure the application has access.
Comments powered by CComment