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?

Comments

webchick’s picture

StatusFileSize
new2.58 KB

Here's a simple re-roll with -up applied so it's a bit easier to review. Please don't credit on commit.

webchick’s picture

Status: Needs review » Needs work

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

webchick’s picture

Documentation on direct message return elements can be found at http://apiwiki.twitter.com/REST+API+Documentation#Directmessageelement.

eaton’s picture

Status: Needs work » Postponed

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

xurizaemon’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Postponed » Active

I'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.

FergalMohan’s picture

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

Jaesin’s picture

Status: Active » Closed (won't fix)

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