Modify

#996 closed defect (fixed)

Switch to Twitter API 1.1 (with JSON and probably streaming API)

Reported by: ilf@… Owned by:
Priority: normal Milestone:
Component: Twitter Version: devel
Keywords: Cc:
IRC client+version: Client-independent Operating System: Public server
OS version/distro:

Description

Twitter is changing their API from Version 1 to 1.1.

"Version 1 of the REST API is now deprecated and will cease functioning in the coming months."

In current Snapshot, "status/destroy" already fails:

"<@root> twitter - Error: Could not retrieve /1/statuses/destroy/0.xml: 404 Not Found (Sorry, that page does not exist)"

AFAICT, this changed to "statuses/destroy/:id"

https://dev.twitter.com/docs/api/1.1/post/statuses/destroy/%3Aid

Attachments (0)

Change History (9)

comment:1 Changed at 2012-10-10T11:04:26Z by wilmer

Just to clarify, you get that after manually setting the API version to 1.1?

Joy. Can't wait for incompatibilities between Twitter API implementations to increase (even further).

comment:2 Changed at 2012-10-10T11:15:48Z by ilf

Nope, I didnt change anything.

comment:3 Changed at 2012-10-10T11:19:27Z by wilmer

What a lovely bunch they are.

Well, time to catch up for the next release I guess..

comment:4 Changed at 2012-10-13T22:54:03Z by wilmer

Much more important change in 1.1: They dropped XML support.

Say bye-bye to Twitter support in BitlBee for a while, I guess..

comment:5 Changed at 2012-10-15T07:54:50Z by twitter user

No no no noooo!

comment:6 Changed at 2012-10-28T18:41:37Z by wilmer

Summary: Twitter API changeSwitch to Twitter API 1.1 (with JSON and probably streaming API)

Looked at some JSON libs. Got my eye on this one now:

https://github.com/udp/json-parser

Single (~700 lines) file, no special dependencies, built-in tree building (whereas for XML I use GLib's simple XML parser with my own XML tree builder). Performance is fine. Some simple tests show that on my machine it can parse about 90KB of JSON per ms (my xmltree does 60-70KB per ms). Memory usage is a little lower as well.

License is okay as well (modified BSD). Now all I need is time..

comment:7 Changed at 2012-11-08T10:16:19Z by wilmer

That turned out to be relatively easy. :-) Lots of cleanup to do still, but there's no need to hurry yet.

comment:8 Changed at 2012-11-12T10:23:31Z by wilmer

The json branch is getting more stable now. I'm running it fulltime with the streaming API. The streaming API gives you stuff like mentions and DMs for free (and with a usable latency).

Disadvantages are that you get a full feed of everything. No deduping of retweets and also the mentions stuff seems a little trigger-happy as I was getting retweets like this:

00:43:33  WilmerRam| [23] RT @Natasha__Ivanov: Me gustaria que yo fuese un fosforo y tu una vela, 
                     para verte derretir cuando yo t de candelaxD locoooooooo @WilmerRamirez6

So that's a simple string match for "@Wilmer" instead of a whole-word match. BitlBee will have to do some filtering here.

I've enabled nightly builds for this branch so if anyone wants to give it a shot, feel free!

comment:9 Changed at 2012-12-22T00:17:05Z by wilmer

Resolution: fixed
Status: newclosed

Merged in changeset:devel,951.

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.