Imp posts facebook updates

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.

  1. Device with imp sends the trigger to agent.
  2. 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)
  3. 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.

You can send Email to your secret address. I explained how to find your own address today in this forum.

@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.

It’s finally working. I am using facebook access token to post updates. I am still not sure how to make it work for more than one user.

const url = “https://graph.facebook.com/user-id/feed”;

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);