microblog engine and app

Sebastian Kügler sebas at kde.org
Thu Apr 26 15:13:42 UTC 2012


Hi all,

As you might know, I've been working on a microblog app, done in Plasma Quick.

This app comes in different disguises, as tablet-app, as desktop app and as 
widget. It uses PlasmaComponents throughout and adapts itself to screen space 
available.

http://simplest-image-hosting.net/png-0-y22117

I've taken the Microblog QML widget, and improved it in many places, mainly 
rewriting smaller components to be shared, and polishing those. I'm beginning 
to be quite happy about the UI side, although it's not completely done yet.

In order to get the most out of the microblog dataengine, I ended up rewriting 
large parts of it, especially:

(1) authorization: now done using QOAuth
(2) avatar handling: now uses an imagecache to reduce network load and traffic
(3) feed parsing: now uses JSON instead of XML: faster, less traffic, more 
    features in feeds

There's also a good deal of internal restructuring involved, authorization 
handling is now delegated to a helper class which is managed by the engine, 
sources use an appropriate helper where necessary. This makes user switching 
quite a bit easier, as the engine is now better able to deal with different 
accounts. The Microblog C++ Plasmoids still seems to work (gains from some, 
but not all of these changes), but as the QML Plasmoid is more than capable of 
everything the C++ widget does, I'd in fact like to replace that widget 
(recycling its plugin name for the QML Plasmoid).

As to (1), authorization: This adds a new dependency on QOAuth, it seems it's 
packaged by most distros already, so I don't really expect huge problems 
there, however, it's still an additional dep, and non-optional (in the sense 
that you won't get the dataengine if QOAuth is not there). The app or engine 
does not save the password anymore, it rather saves the oauth accesstoken and 
-secret to a koauthrc config file. This could also go into kwallet, not 100% 
sure about that ... thoughts?

As to (2), we use the same imagecache file as the previewengine, so these are 
in principle shared. This one greatly reduces network traffic, since images 
are loaded in one http request per tweet. Results in a pretty noticable 
speedup.

As to (3), this brings another additional dependency in. The reason to use the  
JSON format instead of XML are:
	- the XML feeds do not contain all information, so we end up needing a lot 
	  of extra requests
  - the files are a lot smaller, I've measured about 40% smaller files for 
    JSON feeds than for XML feeds
  - Code is smaller, JSON is a bit easier to parse (it basically puts 
    everything into a map for you to pick from)
	- Twitter recommends JSON above XML

The dataengine changes are in sebas/qoauth2 branch in kdeplasma-addons, in 
order to test the app, you need that branch. The applet and app are in 
declarative-plasmoids master, under microblog/.

I'd like to merge especially the engine changes shortly, but as it's quite a 
huge branch, maybe someone could look over those changes?

Thanks
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list