Adding new microblogging service. where to start?

Asked by Karlis Lauva

Hi!

A local social networking site just released it's API, and I want to add it's microblogging service to Gwibber. I will try to modify existing scripts (for ie ping.fm) in /usr/share/pyshared/gwibber/microblog/, but I wanted to ask: which files also need to be modified, so I can add my account through accounts>create.

Thanks in advance,

-skazhy

Question information

Language:
English Edit question
Status:
Answered
For:
Gwibber Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ryan Paul (segphault) said :
#1

To add support for a new service in Gwibber, you have to create a new module in the gwibber/microblog directory. Each module must have a PROTOCOL_INFO section, a Client class, and a Message class. The PROTOCOL_INFO block provides metadata about the service's options and capabilities. For an example of what a PROTOCOL_INFO block should look like, see the twitter.py module.

The purpose of the Message class is to parse the data that is returned by the web service and expose it with standard attributes that are used by the template engine for rendering the messages. Each individual item that will appear in the Gwibber stream has an associated Message instance.

The Client class is responsible for communicating with remote web services and emitting Message instances. There are several standard methods that are used in Client classes, including send, receive, responses, and search. To see which methods are supported, view the master Client class in microblog/__init__.py.

To register your service module, import it in microblog/__init__.py and add it to that module's PROTOCOLS table. You also have to add an account properties dialog to ui/preferences.glade and make it use widget names that match the preference names listed in your service module's PROTOCOL_INFO section.

Please note that this architecture is subject to change and could be significantly different in Gwibber 2.0.

Can you help with this problem?

Provide an answer of your own, or ask Karlis Lauva for more information if necessary.

To post a message you must log in.