I had heard recently about Amazon Echo, and I found interesting this contest. But did not have much information about it so I tried to make a simple but useful and interesting project. As can be count how many likes has a fanpage.First
For fast starting, you need read and replicate this tutorialSecond
Replicate the same tutorial, but this time clone the HelloWorld Sample onThird
Enjoy, modifying the Hello World Sample.
For access to Graph API of Facebook, you need and access_token, or a FB App and use its ID an Secret key (as access_token) then you call the url
var url = 'https://graph.facebook.com/v2.0/414718878625776?fields=fan_count&access_token=app_id|app_secret;
After, you need install the sync-request library (request libraries ins't async and that is a big problem)
npm install sync-request
After, a simple test.js for get the count of likes
var request = require('sync-request'); var url = 'https://graph.facebook.com/v2.0/414718878625776?fields=fan_count&access_token=aaaaa|xxxxxx'; var res = request('GET', url ); var data = JSON.parse(res.getBody('utf8')); console.log(data.fan_count);
Finally, add this code to Hello World Sample, modify the Invocation Name and Intents & Utterances
Also, you can replicate this skill for you own Fanpage.
My Skill was certified on 28 Apr; after too intents u.u
And now you can use it in your Amazon Echo ;)