Modify

#593 closed enhancement (fixed)

identi.ca/status.net support

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

Description

Since identi.ca/status.net are API-compatible to Twitter, support should be easy: http://status.net/wiki/TwitterCompatibleAPI#API_root

F.e. how about a variable $api_url per account?

Attachments (0)

Change History (9)

comment:1 Changed at 2010-05-22T15:21:37Z by wilmer

I have just confirmed that this:

=== modified file 'protocols/twitter/twitter_lib.h'
--- protocols/twitter/twitter_lib.h	2010-03-25 21:31:27 +0000
+++ protocols/twitter/twitter_lib.h	2010-05-22 15:03:05 +0000
@@ -28,7 +28,7 @@
 #include "nogaim.h"
 #include "twitter_http.h"
 
-#define TWITTER_API_URL "http://twitter.com"
+#define TWITTER_API_URL "http://identi.ca/api"
 
 /* Status URLs */
 #define TWITTER_STATUS_UPDATE_URL TWITTER_API_URL "/statuses/update.xml"

(plus disabling OAuth) is enough to make the module work with identi.ca. Sadly converting this constant into a setting that can be changed at runtime is going to be a little bit painful/tedious. Will try to figure out some way. :-/

comment:2 Changed at 2010-05-22T15:56:58Z by ilf

It would be cool to enable a generic StatusNet support, I have been using StatusNet installations other than identi.ca.

Also, why disable OAuth? StatusNet 0.9.0 has "Support for OAuth authentication in the Twitter API." in its release notes: http://status.net/2010/03/04/statusnet-0-9-0-released

Doesn't that mean that OAuth authentication is possible on the StatusNet API? Or does that only mean StatusNet can authenticate with the Twitter API via OAuth?

No OAuth and no SSL combined are total FAIL. Passwords in plain text make me a sad panda. Especially if it's sent every minute :(

comment:3 Changed at 2010-05-22T16:00:24Z by Wilmer van der Gaast <wilmer@…>

You can use SSL though. I haven't tried, but it should also just work.

Don't know about OAuth, http://status.net/wiki/TwitterCompatibleAPI#Authentication says it's http-basic only but it looks like they're fixing that then. BitlBee will just need the OAuth URL (base) as well then.

(And I assume that if this works, any StatusNet installation should work.)

comment:4 Changed at 2010-05-23T01:15:35Z by wilmer

02:08:21 <@wilmer> account add twitter wilmer qwerty
02:08:22 <@     root> Account successfully added
02:08:23 <@wilmer> account set 7/base_url http://identi.ca/api
02:08:24 <@     root> base_url = `http://identi.ca/api'
02:08:24 <@wilmer> account set 7/oauth off
02:08:27 <@     root> oauth = `off'
02:08:28 <@wilmer> account on 7
02:08:29 -!- twitter_wilmer [twitter_wilmer@twitter] has joined &bitlbee
02:08:29 -!- ServerMode/&bitlbee [+v twitter_wilmer] by peer.bitlbee.org
02:08:29 <@     root> twitter(wilmer) - Logging in: Connecting to Twitter
02:08:30 <@     root> twitter(wilmer) - Logging in: Logged in

Works. :-) I'll take one more look at the change with a more awake eye before I commit.

Setting base_url to https://twitter.com/ also works properly.

comment:5 Changed at 2010-05-23T12:54:07Z by wilmer

changeset:devel,587 has this.

If you feel like trying it out, please do.

comment:6 Changed at 2010-05-24T10:39:56Z by ilf

I can confirm this works with identi.ca. Without OAuth, but with SSL.

I have not gotten it to work with another installation of StatusNet, but that might be the installations fault. Unfortunately, I cannot debug this further.

comment:7 Changed at 2010-05-24T10:42:00Z by ilf

The OAuth URL is hardcoded, though. When accidentially leaving oauth enabled, it connects to https://api.twitter.com/

Might be good to adjust that according to base_url.

Also, maybe StatusNet accounts don't need to be called 'Twitter'. Having a Twitter and an identi.ca account, they cannot be distinguished.

comment:8 Changed at 2010-05-24T10:49:03Z by Wilmer van der Gaast <wilmer@…>

The OAuth URL is hardcoded, though. When accidentially leaving oauth
enabled, it connects to https://api.twitter.com/[[BR]]


Might be good to adjust that according to base_url.


The base URLs aren't exactly the same so it's not that easy. Also I
haven't seen a guarantee in the spec (but I read an old version) that
there's one base url with consistent call names. Please correct me if
I'm wrong though, since I hope I am.

Also, maybe StatusNet accounts don't need to be called 'Twitter'. Having a
Twitter and an identi.ca account, they cannot be distinguished.


You can rename the twitter_yourusername contact to something else to
reflect that.

The Twitter module *could* register a Twitter and an identica protocol
with different defaults. Not sure if doing this for every single Twitter
API service is sane though...

comment:9 Changed at 2010-07-17T15:40:37Z by wilmer

Resolution: fixed
Status: newclosed

Oh, this is done now, and the Twitter API module registers an identica service as well. See also #648.

Modify Ticket

Action
as closed The owner will remain geert.
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.