Friday, July 22, 2011

public transport plasmoid looking for your input

The Public Transport Plasmoid is a rather useful and pretty cool tool to look up information on, as the name clearly implies, public transit in your area.



I really like the ability to quickly see route information with times and associated alerts for my home station, and with multiple instances of the Plasmoid I can keep track of several stations quite easily at a glance. The journey features are also indispensible.

Using it with Contour, which is getting support for random Plasmoids in addition to the Nepomuk-derived resources that are associated with an activity, is going to be very, very nice for someone like me who travels a fair amount: I'll end up with one Activity on my tablet per trip with all my files, contacts and even transit information agregated in one place that I can switch to with a simple thumb swipe. Oh, yeah!

A new version was released today and I noticed that the author of Public Transport has put together a set of polls asking people what they think of the UI changes in the new version, which transit systems you use it with and how you get and install it.

If you're a user of Public Transport, register your vote to help Friedrich know how to continue improving it. If you aren't a user of this Plasmoid and you use public transit in your area .. go install it and then go vote. ;)

Contributing new transit system backends or improving the existing ones is probably also very welcome. I noticed recently that the SBB backend doesn't seem to work nicely for journeys anymore, which probably has to do with their recent website upgrade which changed things significantly. Since the SBB doesn't provide a public API (though they have one!), Public Transport is just page scraping which is pretty brittle. I don't know if that is the cause of the errors, but I wouldn't be surprised. Anyone who wants to give me a nice gift could fix it up (I unfortunately do not have time right now to do so with everything else on my plate *sob*). :)

.. and in case anyone at SBB is reading this: open up your API already. It's public information and you're only hurting the society you provide service to with your policies that come straight out of the dark ages.

15 comments:

tobaj said...

I'm struggling with building it on Ubuntu and can't find any useful info on Internet. Available debs are too old.

zapp said...

@tobaj
https://bugs.launchpad.net/ubuntu/+bug/395373
Seems that the Kubuntu guys are not interested...

Maybe it'll be faster if it gets into Debian first?

tobaj said...

Well, I can't wait for that can I:) BTW I've seen another requests from (k)ubuntu users for this plasmoid. But even though there is high demand they still don't seem to care.

I think I'm gonna build it myself. The trouble is there are several 'modules'. I don't what to start with and what's the minimum to build to make the plasmoid usable?
As there's no even old version in kubuntu repositories I can't find out easily what dependencies are needed (using apt-get build-dep ..). So I'll have to figure it out from what cmake/gcc say. So it's gonna be painful..

zapp said...

There are some old .deb packages for Lucid (v0.8.3, linked from the kde-look.org page).
I had them installed on Natty as well, some time ago. They are outdated but worked fine.

Maybe you can use them as a starting point.

Aaron J. Seigo said...

i just put a CMakeLists.txt in the top level directory with this in it:

add_subdirectory(libpublictransporthelper)
add_subdirectory(applet)
add_subdirectory(applet-graphicaltimetableline)
add_subdirectory(engine-openstreetmap)
add_subdirectory(icons)
add_subdirectory(runner)
add_subdirectory(applet-flights)
add_subdirectory(engine)
add_subdirectory(timetablemate)

note that you may need to adjust the build order in the runner/ directory so that the config directory builds first.

but with a top level cmake file like the above, it's pretty painless :)

oh, and you need the KWebKitPart install and manually install headers for timetablemate .. but timetablemate is just a devel tool, so you can just not build that by removing it from the top-level CMakeLists.txt

hth...

tobaj said...

@zapp
Yes, I've seen the old debs. But I'm not that desperate to try ANY version of publictransport. I want the NEWEST one! I mean built, the source I've got already from git :)

@Aaron J. Seigo
Thanks for the tip.

KWebKitPart (Kubuntu guys pack it as kpart-webkit) may be the first problem.
It doesn't seem to be packaged yet in the current Kubuntu dev (11.10) repository.
I failed to compile the master branch as now it depends on kde 4.6.95 while the latest in kubuntu repo is still 4.6.90.
As I'm not going to try to build the whole kde environment, what I could do is:

1) revert some last commits from KWebKitPart master to drop the dependency to to >4.6.95

2) switch to branch 1.2

3) wait for kubuntu kde updates and then compile KWebKitPart from master

tobaj said...

I'm posting this for the 3rd time. Previous 2 comments dissapeared (myabe because I sent one from a different account, accidentaly)

----------------------------------------------

KWebKitPart built painlessly from branch 1.2

With Publictransport I got stuck when compiling the first component (configuration seemed to go ok). Pasting some output below:

[ 18%] Building CXX object runner/CMakeFiles/krunner_publictransport.dir/publictransportrunner.o
In file included from /media/lamus/repos/git-repos/publictransport/runner/publictransportrunner.h:26:0,
from /media/lamus/repos/git-repos/publictransport/runner/publictransportrunner.cpp:20:
/media/lamus/repos/git-repos/publictransport/runner/config/publictransportrunner_config.h:24:44: fatal error: ui_publicTransportRunnerConfig.h: No such file or directory
compilation terminated.
make[2]: *** [runner/CMakeFiles/krunner_publictransport.dir/publictransportrunner.o] Error 1
make[1]: *** [runner/CMakeFiles/krunner_publictransport.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[...]
[...]
[...]
Linking CXX shared library ../lib/libpublictransporthelper.so
[ 43%] Built target publictransporthelper
make: *** [all] Error 2

Aaron J. Seigo said...

@tobaj: for whatever reason, blogger thought you were posting spam. if it doesn't show up immediately, usually just wait a bit and i'll end up eventually clicking it through :)

anyways .. that build error is the one i mentioned where you need to change the order of the build in the runner/CMakeLists.txt file so that the config builds first.

i actually fixed this in git today for Freidrich so the next release will have this fixed already.

tobaj said...

@Aaron J. Seigo
Thanks for getting back to me. Both missing comments did show up for a moment and they were still present after first refresh. They disappeared after a while.

I can't see CMakeLists.txt in the runner directory. Unless (very likely) I misunderstood..

tobaj said...

Gah, scratch my previous post.. I was looking for it in the build/runner directory!!

tobaj said...

Right, I removed the local repo and cloned again. I see the commit you were referring to in git log:

commit 19448dfe8acaa1d03bf123423bd3c47099f0f429
Author: Aaron Seigo
Date: Fri Jul 22 12:09:37 2011 +0200

build the config first so that on a fresh build the ui files get process for header inclusions in the runner

and this the contents of runner/CMakeLists.txt:
http://pastebin.com/XtpbREG3

According to your instructions it seems correct to me. But I still get the same error (building the same way - in ./build, after placing suggested CMakeLists.txt in ./)

Arnomane said...

All the data how exactly to retrieve a specific public transport information system is already available in a free database for years.

You just need to import it from http://wiki.serchilo.net. This wiki is the database backend of the free database search engine
http://serchilo.net. Especially for Germany (http://de.serchilo.net) many public transport systems are listed there with their query-URLs.

Some years ago for example I imported there the information for my local public transport from Nuremberg:

http://wiki.serchilo.net/Verkehrsverbund_Gro%C3%9Fraum_N%C3%BCrnberg_Fahrplanauskunft

Since that day I am using Serchilo in my browser (for example in Konqueror "vgn:nürnberg lorenzkirche, fürth rathaus") in order to quickly get the next public transport connection.

I also asked if Serchilo could be imported into Konqueror, so that Konqueror always has a up-to-date web shortcuts available:

https://bugs.kde.org/show_bug.cgi?id=137096

Oddly it was never imported. ;-(

You don't need to use Serchilo as a proxy. You could also download the database on a regular base (e.g. a packet provided via GHNS-feature) and directly access the target query pages in your applet... And of course with the help of Serchilo you could also generalize the applet a bit to other means beside public transport...

venturi said...

Would be happy to test, but it doesn't compile here :
http://pastebin.com/GaHvpkEE

(on fedora x86_64 + kde 4.6.95)

Arnomane said...

By the way... The complete query-URLs for SBB can be found here:

http://wiki.serchilo.net/Schweizerische_Bundesbahnen_Fahrplanauskunft

So you just can take them from there and integrate them into the plamsoid without further page scraping. :-)

arnomane said...

P.S.: Yesterday I had written a larger comment about the platform "Serchilo" and my past attempts to integrate it into KDE but it somehow was lost in your blog comments (perhaps some spam filter or whatever).