Wednesday, October 17, 2007

DCOP: Scripting the KDE Desktop

KDE provides a powerful interprocess communication system in DCOP, the Desktop COmmunication Protocol. Using DCOP, you can control a wide range of functions in KDE from the command line or from a script written in your favorite scripting language. You can also get information out of KDE applications: for example, several KDE media players provide methods to query the player for information about the currently-playing track.

For the whole Artical can be seen HERE

I found this when I was trying to write a script that will change my desktop to the Daily comic strip Dilbert automatically
Then I found the DCOP command
#dcop kdesktop KBackgroundIface setWallpaper /tmp/dilbert.gif 1

The Above command will change your desktop wallpaper to /tmp/dilbert.gif

If any one interested to see the script the script is at link given bellow
python script source code

Sunday, October 14, 2007

Script to Automate Download Google Videos

I had to download a large number of google videos this week. But I was fade up with the pasting the url in to sites like then click on the download links then downlaod videos. I had a defined list of videos to be downlaoded, so I decided to write my own programm to download these files automatically from a commandline program.
My program reads the filename given in the commndline and then treats each line of the file as a google video entry and filename given separated by pipe.
Format is as shown bellow

# cat testurl.txt|testvdo.flv|testvdo2.flv
(testurl.txt can be downloaded from HERE

The python code is as given bellow

Python Code File
I am too lazy to format code in blogger post, so I have uploaded the file.

Save the python code as file name
make sure you have testurl.txt file with the google video urls, then run the code by command given bellow
python testurl.txt

Any suggestions welcome
Now Some LEGAL Crap

 Is this tool legal?

From "You may not send
automated queries of any sort to Google's system without express
permission in advance from Google."

This means that you should not use this tool to query Google without
advance express permission. Google appliances, however, do not have these
limitations. You should, however, obtain advance express permission from
the owner or maintainer of the Google appliance before searching it with
any automated tool for various legal and moral reasons.

The author wrote this tool not to violate Google's terms of service (ToS)
but to automate some of his work.