[Kde-imaging] 23hq export plugin

Daniel Isenmann daniel.isenmann at gmx.de
Wed Feb 11 18:23:38 CET 2009


On Wed, 11 Feb 2009 09:33:02 +0100
Andrea Diamantini <adjam7 at gmail.com> wrote:

> Il Tuesday 10 February 2009 23:02:29 Angelo Naselli ha scritto:
> > Il martedì 10 febbraio 2009 19:10:07 Daniel Isenmann ha scritto:
> > Hi,
> >
> > > it's the first time I contribute/post to this mailinglist. I have
> > > searched through the bugtracker and haven't found an entry for
> > > this topic, so here it comes.
> > >
> > > I'm using 23hq (http://www.23hq.com), it's a online photo
> > > community like flickr. Like flickr, it uses nearly the same API
> > > as flickr for the communication with their webservice.
> > >
> > > For the first proof-of-concept I have modified the existing
> > > flickr-export plugin from kipi to communicate with 23hq. It works
> > > without problems on my computer, but I have to do some further
> > > refactoring of the source code. It's heavily based on the
> > > flickr-export plugin, not to say it's nearly the same with some
> > > small changes.
> > >
> > > After the refactoring, I will post the plugin to this
> > > mailinglist, to any other person or the bugtracker. What is the
> > > official way for a new plugin? Is there an official document, how
> > > to submit new plugins, etc.?
> > >
> > > I hope that their was no effort of another person who wants to
> > > implement this plugin. If so, let my know.
> >
> > Writing here it's ok, but open a bug-report with patches should be
> > better. Anyway even if i always dream a common export plugin one
> > day will be done (col don't hide yourself someone is thinking of
> > you :p ), you can also contact  Andrea, Colin, Vardhman or Gilles
> > for that.
> >
> > Thanks for contributing,
> >
> > 	Angelo
> 
> Hi Daniel, and welcome aboard!!
> I never heard about someone working on hq23 plugin. So feel free to
> work on. Anyway, pls DON'T change APIs in your refactoring. If we
> have a chance to have one day a unique "export plugin", that's the
> way. I'm not sure we can add this plugin now. We need to know what
> Gilles says. And post the plugin here (or somewhere else) when it's
> ready.
> 
> Please read this (http://techbase.kde.org/Contribute).
> See you soon,
> 

Thanks for the warm welcome...

All of you mentioned to have a unique export plugin for this. I'm
thinking the same way, one plugin which can handle different
webservices. 

Especially for this plugin, it would be really easy to change the
flickr export plugin to serve both services (flickr and 23hq). The only
thing to add is a combo box to choose which service you like.
Corresponding to this choice, the plugin must connect to the given
service. 

I will post here the changes to the flickr-plugin, it's a huge patch as
text, but it's not that difficult at all, just changing the URLs:

--------snip-------------

--- flickrtalker.cpp	2009-01-21 10:09:32.000000000 +0100
+++ flickrtalker.cpp_new	2009-02-11 18:10:46.000000000 +0100
@@ -100,7 +100,7 @@ FlickrTalker::~FlickrTalker()
 }
 
 /** Compute MD5 signature using url queries keys and values following
Flickr notice:
-    http://www.flickr.com/services/api/auth.spec.html
+    http://www.23hq.com/services/api/auth.spec.html
 */
 QString FlickrTalker::getApiSig(const QString& secret, const KUrl& url)
 {
@@ -146,7 +146,7 @@ void FlickrTalker::getFrob()
         m_job = 0;
     }
 
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("method", "flickr.auth.getFrob");
     url.addQueryItem("api_key", m_apikey);
     QString md5 = getApiSig(m_secret, url);
@@ -180,7 +180,7 @@ void FlickrTalker::checkToken(const QStr
         m_job = 0;
     }
 
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("method", "flickr.auth.checkToken");
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("auth_token", token);
@@ -215,7 +215,7 @@ void FlickrTalker::slotAuthenticate()
         m_job = 0;
     }
 
-    KUrl url("http://www.flickr.com/services/auth/");
+    KUrl url("http://www.23hq.com/services/auth/");
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("frob", m_frob);
     url.addQueryItem("perms", "write");
@@ -252,7 +252,7 @@ void FlickrTalker::getToken()
         m_job = 0;
     }
 
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("method", "flickr.auth.getToken");
     url.addQueryItem("frob", m_frob);
@@ -281,7 +281,7 @@ void FlickrTalker::getToken()
 void FlickrTalker::listPhotoSets()
 {
     kDebug(51000) << "List photoset invoked" << endl;
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("method", "flickr.photosets.getList");
     url.addQueryItem("user_id", m_userId);
@@ -312,7 +312,7 @@ void FlickrTalker::getPhotoProperty(cons
         m_job = 0;
     }
 
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("method", method);
     url.addQueryItem("frob", m_frob);
@@ -360,7 +360,7 @@ void FlickrTalker::createPhotoSet(const 
     }
 
     kDebug( 51000 ) << "create photoset invoked" << endl;
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
     url.addQueryItem("auth_token", m_token);
     url.addQueryItem("api_key", m_apikey);
     url.addQueryItem("method", "flickr.photosets.create");
@@ -395,7 +395,7 @@ void FlickrTalker::addPhotoToPhotoSet(co
     }
 
     kDebug( 51000 ) << "addPhotoToPhotoSet invoked" << endl;
-    KUrl url("http://www.flickr.com/services/rest/");
+    KUrl url("http://www.23hq.com/services/rest/");
 
     url.addQueryItem("auth_token", m_token);
 
@@ -436,7 +436,7 @@ bool FlickrTalker::addPhoto(const QStrin
         m_job = 0;
     }
 
-    KUrl    url("http://api.flickr.com/services/upload/");
+    KUrl    url("http://www.23hq.com/services/upload/");
 
     // We dont' want to modify url as such, we just used the KURL
object for storing the query items. 
     KUrl  url2("");

--------snap------------

That's all. Just chaning the url. Now you can upload the photos to
23hq. It's completely the same workflow as with flickr, everything
worked here. I haven't coded with Qt4 before otherwise I had posted a
patch for the combo box and necessary changes, but I think this is very
easy to add. If it isn't requested, then I will change the flickr
plugin to a 23hq plugin, change the name of the classes and library and
will post it here as a new plugin. 

So, what do you think about integrate it into the flickr export plugin
as an alternative option?? I would prefer it and I'm willing to help
out with the plugin, after I have read a little bit about Qt4 (which
isn't much complicated, from what I have read now), if help is wanted.
C++ experience are here from my side.

Cheers,
 Daniel


More information about the Kde-imaging mailing list