I am making a device with electric imp that can post on my facebook profile, whenever it is triggered. I am planning to use IFTTT for that, and found a few examples where internet channels are used to trigger imp. I am approaching this from the opposite direction where imp is used to trigger the facebook update. I might design an application where I can enter facebook credentials, but this is a one-way connection. I don’t want to send any trigger from facebook to imp.
Device with imp sends the trigger to agent.
Agent sends the http request to any ifttt channel (I am not able to decide the channel as I am not sure how to do this, but I am thinking e-mail could be the best option. Please, suggest)
ifttt sends the message to facebook.
I would really appreciate if someone can help me figure out the best way to approach it.
I was looking at the FaceBook API’s … I’m not sure why they made them so complicated and hard to use. I was thinking that if you had a website, you could use PHP to POST to FaceBook … PHP being triggered by the imp/agent. You would think the agent could POST directly to FaceBook, which it could if anyone was able to figure out how FaceBook API works. I don’t think even FaceBook knows how it works. FaceBook is all PHP … and it’s been cobbled together over the years. Not very easy to use.
@mlseim: I foolowed your instructions, and created a script to post on fb on my googledrive server. I am trying to call that server page where script is written using imp. I think that I need to use http.post method to call that script, but not really sure. I am not able to figure out anything using imp documents, so it would be great if you could point me in right direction.
function post(url){
local body = http.urlencode({access_token=“user_access_token”, message=“Posting facebook updates using my #electricimp”});
local request = http.post(url, {}, body );
local response = request.sendsync();
server.log(response.body);
return response;
}
post(url);