twitter.inc doesn't support fetching direct messages. Attached patch adds twitter_direct_messages() and a convert function. The arguments need to be documented and I've only roughly tested.
Also (important), it uses http_build_query() to build the request arguments. http_build_query() is PHP 5 only so I don't know if you want do support PHP 4 and do this differently?
I'm also interested in making twitter.inc a full API only to Twitter or even breaking the API functions out into their own module. For what I'm exploring using Twitter for I do not need a block of updates, or hooking into nodes for tweeting about posts. Also, perhaps identi.ca support could get its own file?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | twitter-direct-messages-365877-1.patch | 2.58 KB | webchick |
| twitter_direct_messages.patch | 1.94 KB | coltrane |
Comments
Comment #1
webchickHere's a simple re-roll with -up applied so it's a bit easier to review. Please don't credit on commit.
Comment #2
webchickHm. Rather than converting a direct message to a status and mooshing it into the same table, it seems like it'd be best if we added a separate table for DMs.
There would also need to be Views integration added to this table, in addition to an update function to add it to existing sites.
Comment #3
webchickDocumentation on direct message return elements can be found at http://apiwiki.twitter.com/REST+API+Documentation#Directmessageelement.
Comment #4
eaton commentedThis is probably going to be put off until the 3.x release, which is currently under development. It has a dedicated schema for DM's.
Comment #5
xurizaemonI'm interested in DMs (I want to submit instructions to a Drupal bot via DM) so keen to dig on this one.
@eaton, what were your plans re 'dedicated schema for dms' here? You are thinking a separate table, not just a few extra cols? Presumably one of sender or receiver screen name will be local. And we'd need at least one "other_party_screenname" text column and maybe a way to tell if this is a sent or recvd.
Comment #6
FergalMohan commentedHas there been any further development on Twitter Direct Messages that supports the oAuth mechanism? I'm presuming that the old authentication method in this Patch i.e. sending the Twitter password is a no no.
Comment #7
Jaesin commentedThis is a good idea but it has obviously been abandoned.
I would also like to see twitter.inc broken out into it's own module and expanded upon.