Bug 204219 - Support for wetter.com weather provider
Summary: Support for wetter.com weather provider
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-weather (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-17 23:54 UTC by Thilo-Alexander Ginkel
Modified: 2010-01-11 10:12 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample BASH script for getting wetter.com data. (1.21 KB, application/octet-stream)
2009-09-29 11:13 UTC, Gerhard Gappmeier
Details
Fix PROJECTNAME and APIKEY (667 bytes, patch)
2010-01-10 11:12 UTC, Thomas Kamps
Details
Patch to get weachterwallpaper to work with wetter.com ion (661 bytes, patch)
2010-01-10 14:19 UTC, Thomas Kamps
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thilo-Alexander Ginkel 2009-08-17 23:54:21 UTC
Version:            (using KDE 4.3.0)
Installed from:    Ubuntu Packages

Currently the weather plasmoid does not very well support locations in Germany as the BBC data source does not know most German cities. Adding support for wetter.com would change this. Details for their API are available at: http://www.wetter.com/api/uebersicht/ (in German)

The introduction at the above mentions a limitation to 10.000 queries / month for the free version, so I am not entirely certain whether adopting this data source for KDE would make sense.

I am willing to help getting (and translating) all the necessary documentation. When it comes to the actual implementation, time will most likely be the limiting factor for me.
Comment 1 Gerhard Gappmeier 2009-09-18 17:45:07 UTC
Will Stephenson and I were already in contact with wetter.com and they appreciate the use of their data from the KDE project.

Therefore we've got a special account without any limitations.

I started already to implement a new weather ION for the weather dataengine,
but currently I've no time to work on it, because I'm too busy with my job. KDE is sadly just a hobby for me.

If anyone else wants to start through with the wetter.com ION implementation I can give him/her all information necessary.

regards,
Gerhard.
Comment 2 Thilo-Alexander Ginkel 2009-09-27 17:02:19 UTC
I started playing around with the wetter.com API and would probably give implementing an ION a try (although I cannot promise anything), so I'd be happy about any details (and code fragments) you can provide (as the official API documentation is a little bit scarce - especially with regards to the weather condition codes).
Comment 3 Gerhard Gappmeier 2009-09-29 11:13:19 UTC
Created attachment 37233 [details]
Sample BASH script for getting wetter.com data.

This script contains all information to access the KDE account of wetter.com.
Comment 4 Gerhard Gappmeier 2009-09-29 11:18:12 UTC
I created just a simple script (see above) to test the wetter.com API. I also started to make a new ION just by copying an existing one. But I have not done any coding so far, so this would not be a great help for you at the moment.
Comment 5 Thilo-Alexander Ginkel 2009-10-11 18:48:08 UTC
A first version of a Weather Ion for wetter.com is now available in the KDE SVN at: /trunk/playground/base/plasma/dataengines/weather/ions
Comment 6 Shawn Starr 2009-10-15 22:07:35 UTC
We can close this bug as Thilo has made the ion now. It just needs testing
Comment 7 Will Stephenson 2009-10-15 23:53:55 UTC
Now the fun begins.   Assert on searching for 'berlin':

plasmoidviewer(19253)/plasma WeatherEngine::sourceRequestEvent: sourceRequestEvent(): Network is:  true
plasmoidviewer(19253)/plasma IonInterface::sourceRequestEvent: sourceRequested()
ASSERT: "xml.isStartElement() && xml.name() == "search"" in file /space/kde/sources/trunk/playground/base/plasma/dataengines/weather/ions/ion_wettercom.cpp, line 395
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = plasmoidviewer path = <unknown> pid = 19253
sock_file=/home/wstephenson/.kde4-dev/socket-gorse/kdeinit4__0


Application: Plasma Widget Viewer (plasmoidviewer), signal: Aborted
[Current thread is 1 (Thread 0xb39fb760 (LWP 19253))]

Thread 2 (Thread 0xa842eb70 (LWP 19424)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb6bfe0c2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb6c736ac in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#3  0xb6c6812e in QThreadPoolThread::run() () from /usr/lib/libQtCore.so.4
#4  0xb6c726cf in QThreadPrivate::start(void*) () from /usr/lib/libQtCore.so.4
#5  0xb6bf96e5 in start_thread () from /lib/libpthread.so.0
#6  0xb6bf9600 in ?? () from /lib/libpthread.so.0

Thread 1 (Thread 0xb39fb760 (LWP 19253)):
[KCrash Handler]
#6  0xffffe424 in __kernel_vsyscall ()
#7  0xb5edd0cf in raise () from /lib/libc.so.6
#8  0xb5ede9e7 in abort () from /lib/libc.so.6
#9  0xb6c6a144 in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#10 0xb6c6a363 in qt_message(QtMsgType, char const*, char*) () from /usr/lib/libQtCore.so.4
#11 0xb6c6a488 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#12 0xb6c6a505 in qt_assert(char const*, char const*, int) () from /usr/lib/libQtCore.so.4
#13 0xa7c1c5cd in WetterComIon::parseSearchResults (this=0x85ada28, source=..., xml=...) at /space/kde/sources/trunk/playground/base/plasma/dataengines/weather/ions/ion_wettercom.cpp:395
#14 0xa7c1c4de in WetterComIon::setup_slotJobFinished (this=0x85ada28, job=0x857cc20) at /space/kde/sources/trunk/playground/base/plasma/dataengines/weather/ions/ion_wettercom.cpp:384
#15 0xa7c215cb in WetterComIon::qt_metacall (this=0x85ada28, _c=InvokeMetaMethod, _id=2, _a=0xbfb9e8e8) at /space/kde/builds/trunk/playground/base/plasma/dataengines/weather/ions/ion_wettercom.moc:82
#16 0xb6d7fbfd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#17 0xb6d8ecfb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#18 0xb7007c2e in KJob::result (this=0x857cc20, _t1=0x857cc20) at /space/kde/builds/trunk/KDE/kdelibs/kdecore/kjob.moc:194
#19 0xb700723d in KJob::emitResult (this=0x857cc20) at /space/kde/sources/trunk/KDE/kdelibs/kdecore/jobs/kjob.cpp:304
#20 0xb597d9f3 in KIO::SimpleJob::slotFinished (this=0x857cc20) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/job.cpp:475
#21 0xb59805e7 in KIO::TransferJob::slotFinished (this=0x857cc20) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/job.cpp:975
#22 0xb598805a in KIO::TransferJob::qt_metacall (this=0x857cc20, _c=InvokeMetaMethod, _id=7, _a=0xbfb9eb7c) at /space/kde/builds/trunk/KDE/kdelibs/kio/jobclasses.moc:367
#23 0xb6d7fbfd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#24 0xb6d8ecfb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#25 0xb5a4062f in KIO::SlaveInterface::finished (this=0x84c2080) at /space/kde/builds/trunk/KDE/kdelibs/kio/slaveinterface.moc:171
#26 0xb5a3df1e in KIO::SlaveInterface::dispatch (this=0x84c2080, _cmd=104, rawdata=...) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/slaveinterface.cpp:175
#27 0xb5a3dbc0 in KIO::SlaveInterface::dispatch (this=0x84c2080) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/slaveinterface.cpp:91
#28 0xb5a338a0 in KIO::Slave::gotInput (this=0x84c2080) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/slave.cpp:322
#29 0xb5a3495c in KIO::Slave::qt_metacall (this=0x84c2080, _c=InvokeMetaMethod, _id=2, _a=0xbfb9ee3c) at /space/kde/builds/trunk/KDE/kdelibs/kio/slave.moc:82
#30 0xb6d7fbfd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#31 0xb6d8ecfb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#32 0xb594fc8d in KIO::Connection::readyRead (this=0x81c2668) at /space/kde/builds/trunk/KDE/kdelibs/kio/connection.moc:92
#33 0xb594c5ad in KIO::ConnectionPrivate::dequeue (this=0x8518558) at /space/kde/sources/trunk/KDE/kdelibs/kio/kio/connection.cpp:82
#34 0xb594fc1a in KIO::Connection::qt_metacall (this=0x81c2668, _c=InvokeMetaMethod, _id=1, _a=0x848c918) at /space/kde/builds/trunk/KDE/kdelibs/kio/connection.moc:79
#35 0xb6d7fbfd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#36 0xb6d8a525 in QMetaCallEvent::placeMetaCall(QObject*) () from /usr/lib/libQtCore.so.4
#37 0xb6d8b60f in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#38 0xb628251c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#39 0xb628941d in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#40 0xb765f6d0 in KApplication::notify (this=0xbfba0670, receiver=0x81c2668, event=0x81bccd8) at /space/kde/sources/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#41 0xb6d7a89e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#42 0xb6d7d2a3 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#43 0xb6d7d3fc in QCoreApplication::sendPostedEvents(QObject*, int) () from /usr/lib/libQtCore.so.4
#44 0xb6da782d in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib/libQtCore.so.4
#45 0xb42fa4c2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#46 0xb42fdd98 in ?? () from /usr/lib/libglib-2.0.so.0
#47 0xb42fdebe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#48 0xb6da7311 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#49 0xb633860a in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtGui.so.4
#50 0xb6d78f4d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#51 0xb6d79399 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#52 0xb67a2671 in QDialog::exec() () from /usr/lib/libQtGui.so.4
#53 0xa8525d6a in WeatherConfig::Private::changePressed (this=0x84e1040) at /space/kde/sources/trunk/KDE/kdeplasma-addons/libs/plasmaweather/weatherconfig.cpp:45
#54 0xa8523578 in WeatherConfig::qt_metacall (this=0x84e0b40, _c=InvokeMetaMethod, _id=3, _a=0xbfb9f738) at /space/kde/builds/trunk/KDE/kdeplasma-addons/libs/plasmaweather/weatherconfig.moc:82
#55 0xb6d7fbfd in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#56 0xb6d8ecfb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#57 0xb698aedd in QAbstractButton::clicked(bool) () from /usr/lib/libQtGui.so.4
#58 0xb666af0d in QAbstractButtonPrivate::emitClicked() () from /usr/lib/libQtGui.so.4
#59 0xb666be5b in QAbstractButtonPrivate::click() () from /usr/lib/libQtGui.so.4
#60 0xb666c106 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#61 0xb62dfd51 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#62 0xb666ada0 in QAbstractButton::event(QEvent*) () from /usr/lib/libQtGui.so.4
#63 0xb67161a8 in QPushButton::event(QEvent*) () from /usr/lib/libQtGui.so.4
#64 0xb628251c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#65 0xb6289f6a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#66 0xb765f6d0 in KApplication::notify (this=0xbfba0670, receiver=0x855a098, event=0xbfb9fdb0) at /space/kde/sources/trunk/KDE/kdelibs/kdeui/kernel/kapplication.cpp:302
#67 0xb6d7a89e in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#68 0xb6288d74 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#69 0xb630c47a in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libQtGui.so.4
#70 0xb630ba24 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#71 0xb6338ab8 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib/libQtGui.so.4
#72 0xb42fa4c2 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#73 0xb42fdd98 in ?? () from /usr/lib/libglib-2.0.so.0
#74 0xb42fdebe in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#75 0xb6da7311 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#76 0xb633860a in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtGui.so.4
#77 0xb6d78f4d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#78 0xb6d79399 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#79 0xb6d7d4d0 in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#80 0xb62825c4 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#81 0x08051176 in main (argc=2, argv=0xbfba09d4) at /space/kde/sources/trunk/KDE/kdebase/workspace/plasma/generic/shells/plasmoidviewer/main.cpp:214
Comment 8 Thilo-Alexander Ginkel 2009-10-16 00:53:43 UTC
Weird... Just tried this query, which works on my machine. If you have access to the debug output of kio_http I'd be curious about what URL it is requesting (it should be something like /location/index/search/berlin/project/weatherion/cs/90d5822d9e8b83e1d13be8bf0abf8a76 on api.wetter.com.

What do you get if you manually invoke http://api.wetter.com/location/index/search/berlin/project/weatherion/cs/90d5822d9e8b83e1d13be8bf0abf8a76?

I'll also see how I can improve the error handling so that the Ion no longer crashes when it receives an invalid response.
Comment 9 Thilo-Alexander Ginkel 2009-10-17 13:55:38 UTC
Will, I just committed an updated version of the wetter.com to playground that should no longer crash when invalid data is returned by the web request. Could you please try?
Comment 10 Shawn Starr 2009-12-23 02:33:17 UTC
We can close this. Wetter.com is added for KDE 4.4.
Comment 11 Thomas Kamps 2010-01-09 13:29:37 UTC
I have compared the key with the keys in the scipt and the key in the 
http://websvn.kde.org/tags/KDE/4.3.90/kdebase/workspace/plasma/generic/dataengines/weather/ions/wetter.com/ion_wettercom.h?view=markup

They are different!
The working key is the key from the script. Please replace the key in the ion_wetter.h to get the ion to work
Comment 12 Shawn Starr 2010-01-09 19:38:06 UTC
API key changed in KDE trunk (4.5). We'll need this in 4.4 also then.
Comment 13 Thomas Kamps 2010-01-10 11:12:11 UTC
Created attachment 39731 [details]
Fix PROJECTNAME and APIKEY

I have made a path to fix the PROJECTNAME and APIKEY. I hope this works. (Could not test jet)
Comment 14 Thomas Kamps 2010-01-10 14:19:22 UTC
Created attachment 39735 [details]
Patch to get weachterwallpaper to work with wetter.com ion

I have made a small hack to get the weatherwallpaper to work with the wetter.com ion.
Comment 15 Thilo-Alexander Ginkel 2010-01-10 21:19:54 UTC
Well, both keys being different does not mean that one of them needs to be wrong. Please test the "new" key, the Ion needs more than the standard result fields, which need to be explicitly configured for the respective wetter.com project (I do not have the credentials for the project associated with the key from the script).
Comment 16 Thomas Kamps 2010-01-10 21:40:54 UTC
I have testet my patch and it works well. :)
Also the change with the weather-wallpaper works.
Comment 17 Gerhard Gappmeier 2010-01-11 09:24:40 UTC
I don't know where this new key is from, but IMO you should use the original one,
that applies to the "KDE" project on wetter.com.
This has special settings where wetter.com has turned off any restrictions like how many request per hour can be submitted.
Comment 18 Thomas Kamps 2010-01-11 09:52:04 UTC
The key in my Patch (Comment 13) is taken  from the example bash-script from comment 3
Comment 19 Gerhard Gappmeier 2010-01-11 09:56:51 UTC
Yes, this is the one I created at wetter.com, so this should work unless sombody else made a new arrangement with wetter.com.
Comment 20 Thomas Kamps 2010-01-11 10:12:37 UTC
(In reply to comment #12)
> API key changed in KDE trunk (4.5). We'll need this in 4.4 also then.

You need to change the PROJECTNAME too :)