[Kde-imaging] Flickr export plugin extended to support 23hq.com

Daniel Isenmann daniel.isenmann at gmx.de
Wed Feb 18 23:02:06 CET 2009


On Tue, 17 Feb 2009 23:11:32 +0100
Daniel Isenmann <daniel.isenmann at gmx.de> wrote:

> On Mon, 16 Feb 2009 21:52:54 +0100
> Luka Renko <lure at kubuntu.org> wrote:
> > 
> > > One point to "PhotoSet", they work and displays the PhotoSets
> > > (Albums on 23hq) in the Dropdown-Menu, but if I create a new
> > > PhotoSet, it's generated on 23hq and I can see it there, but not
> > > in the GUI of the plugin. It seems that this is a bug in the API
> > > from 23hq, they don't display it there in the response. I will
> > > talk to the 23hq developer for this issue. So this is not a bug
> > > from the plugin.
> > 
> > OK, keep me posted if something needs to be changed in the code to
> > make this work.
> > 
> 
> Small update for information. I have talked to the 23hq devs and it
> is not a bug from their API. I have misunderstood this point from the
> API. He told me further how it could possible solved. I will check the
> solution tomorrow evening and send a patch if it is working. It is
> maybe just few line of codes, so not really much :)
> 

OK, it was as easy as the 23hq devs told me. 23hq
don't send empty PhotoSets to the public, because of that the request
to retrieve the PhotoSets needs the auth_token. So this is just a small
thing in the code. I have add an if statement around the auth_token
because I don't know if flickr can do it (must be tested from another
person with flickr account, if it will be activated for flickr). 

The only change have to be done in FlickrTalker::listPhotoSets(), just
add the following to the other query items:

----snip-----
    KUrl url(m_apiUrl);
    url.addQueryItem("api_key", m_apikey);
    url.addQueryItem("method", "flickr.photosets.getList");
    url.addQueryItem("user_id", m_userId);
    QString md5 = getApiSig(m_secret, url);
    url.addQueryItem("api_sig", md5);
    
+    if (m_serviceName == "23hq") 
+    {
+    	url.addQueryItem("auth_token", m_token);
+    }

    kDebug(51000) << "List photoset URL" << url;
----snap-----

After the change it works as expected.

Cheers, 
 Daniel




More information about the Kde-imaging mailing list