faceplant

3 views
Skip to first unread message

Mark Hammond

unread,
Aug 25, 2010, 2:18:30 AM8/25/10
to raindr...@googlegroups.com
I've managed to "plant" things in facebook (faceplant - geddit!)

* You need to re-authorize raindrop with facebook via accounts/#facebook
- we now ask for additional permissions (eg, posting on your wall).

* Messages should now be synched, and your facebook "inbox" should
appear in your inflow. Things on your "feed" or "home" will wind up
without the 'personal' tag, so will not appear in inflow. Still lots to
be done here WRT handling facebook fields like "link" etc.

* Messages can be sent - see the sample below. Note that you must
change the "userid" portion to your user-id - a reasonable way to
determine that is to execute 'raindrop-accounts.py export' and look for
the facebook account in the output. The sent item goes out as a
"status" update - there is still a lot to be done here (eg, other types
of facebook messages, populating info about 'links' etc.

* Note the new format of 'body_quoted' - if anyone was using my previous
sample to send tweets, they need to update the body_quoted in that old
sample to what is used below.

Let me know if you strike any problems...

Cheers,

Mark

# send a facebook status update.
import httplib, json
msg = {
'from': {
'domain': 'facebook.com',
'userid': '100...etc..123'
},
'body_quoted': [
{'type': 'text',
'value': 'hello yet again facebook, from raindrop'}
],
}
h=httplib.HTTPConnection("127.0.0.1:5000")
h.request("POST", "/api/messages/send", json.dumps(msg))
resp = h.getresponse()
print "Result: %s: %s" % (resp.status, resp.reason)
print resp.read()

Reply all
Reply to author
Forward
0 new messages