Report Konqueror URLs?

Asked by Benjamin Kudria on 2008-04-16

Is the current uploader supposed to monitor Konqueror URLs? Because I don't see anything on the dashboard telling me what URLs I'm visiting.

If not, this information can be retrieved via DCOP, the KDE inter-process communication bus.

For each open Konqueror window, "dcop konqueror-PID" will show all the open tabs as "html-widgetnnn", where nnn is some number (not quite sure what it means). Each html-widgetnnn has a command to print the url of that tab, like so: "dcop konqueror-PID html-widgetnnn url". To determine the active tab, run "dcop konqueror-PID konqueror-mainwindow#1 currentPart" - this returns the konqueror-PID (already known) and html-widgetnnn, the active tab.

Would it be difficult to add support for this?

Question information

Language:
English Edit question
Status:
Solved
For:
RescueTime Linux Uploader Edit question
Assignee:
No assignee Edit question
Solved by:
Angus Helm
Solved:
2008-04-17
Last query:
2008-04-17
Last reply:
2008-04-17
Angus Helm (angus.helm) said : #1

I threw together a quick attempt, but something odd is going on with my X session ATM.
Try creating an executable file called RescueTimeUploader/extensions/Konqueror/extended_info and put the following lines between the ==== in it:

===============
#!/bin/sh

KONQ_PID=`ps -A | grep konqueror | awk '{print $1; exit}'`
active_konq_pid=`dcop konqueror-$KONQ_PID konqueror-mainwindow#1 currentPart | sed 's/.*(//g' | sed 's/).*//g' | awk -F, '{print $1}'`
widget_id=`dcop konqueror-$KONQ_PID konqueror-mainwindow#1 currentPart | sed 's/.*(//g' | sed 's/).*//g' | awk -F, '{print $2}'`
echo `dcop $active_konq_pid $widget_id url`

===============

Then, edit your setup.py file to add .1 to the version, and re-install.

Benjamin Kudria (bkudria) said : #2

On Wednesday 16 April 2008 18:19:10 pm Angus Helm wrote:
> I threw together a quick attempt, but something odd is going on with my X
> session ATM. Try creating an executable file called
> RescueTimeUploader/extensions/Konqueror/extended_info and put the following
> lines between the ==== in it:
>
> ===============
> #!/bin/sh
>
> KONQ_PID=`ps -A | grep konqueror | awk '{print $1; exit}'`
> active_konq_pid=`dcop konqueror-$KONQ_PID konqueror-mainwindow#1
> currentPart | sed 's/.*(//g' | sed 's/).*//g' | awk -F, '{print $1}'`
> widget_id=`dcop konqueror-$KONQ_PID konqueror-mainwindow#1 currentPart |
> sed 's/.*(//g' | sed 's/).*//g' | awk -F, '{print $2}'` echo `dcop
> $active_konq_pid $widget_id url`
>
> ===============
>
> Then, edit your setup.py file to add .1 to the version, and re-install.

You mean, change it such: version = "64.1" ?

I don't get any errors, and running the app shows the URL correctly! Great!
Is there a way to force an upload?

What other extended info does the RT API support? I assume I can send a
contact name from Kopete (I'll mail you an extension script soon!) - what
else can I provide?

Thanks!

Ben Kudria
--
http://ben.kudria.net | Jabber: <email address hidden>

Best Angus Helm (angus.helm) said : #3

Great to hear that it works! I'll go ahead and add it into the repo. Thanks for figuring out what needed to be done.

There's no way to force an immediate upload ATM.

I'm not entirely sure about sending random extended_info; I believe the application name has to be on a whitelist of applications with extended info for it to work. Also, as far as I know, it's intended for URLs at the moment; they do some processing on them to detect different pages on the same site. I may be wrong. I'll email the RescueTime guys to make sure that Konqueror is on the whitelist.

For Kopete (if extended_info is only for URLs), you can change the executable filename from extended_info to app_name, and it will override the application name. I originally intended to set up something for Pidgin so that the application name became "chat with ____", but Pidgin kept crashing and I switched to Meebo.com before I ended up doing it.

Benjamin Kudria (bkudria) said : #4

Thanks Angus Helm, that solved my question.

Benjamin Kudria (bkudria) said : #5

On Thursday 17 April 2008 00:30:50 am Angus Helm wrote:
> Great to hear that it works! I'll go ahead and add it into the repo.
> Thanks for figuring out what needed to be done.

Thanks for the assistance!

> I'm not entirely sure about sending random extended_info; I believe the
> application name has to be on a whitelist of applications with extended
> info for it to work. Also, as far as I know, it's intended for URLs at
> the moment; they do some processing on them to detect different pages on
> the same site. I may be wrong. I'll email the RescueTime guys to make
> sure that Konqueror is on the whitelist.

Thanks!

> For Kopete (if extended_info is only for URLs), you can change the
> executable filename from extended_info to app_name, and it will override
> the application name. I originally intended to set up something for
> Pidgin so that the application name became "chat with ____", but Pidgin
> kept crashing and I switched to Meebo.com before I ended up doing it.

I might try this, thanks!

Ben Kudria
--
http://ben.kudria.net | Jabber: <email address hidden>