![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Outdated Tutorials & Tips Outdated Tutorials & Tips |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2006
Beans: 15
|
Hey there!
I experimented a little with setting up a job that would get images from Flickr and use them as wallpaper and in my screen saver. It works really well so I just thought I'd put up a little description of what I did. Download the attached file and extract them where you place your programs/scripts. Once you have done this make sure the perl script can be executed: Code:
chmod +x download_from_flickr.pl Code:
sudo cpan Code:
install Flickr::API Once installed, exit cpan by typing "exit". Now we need to authorize the use of this little program in Flickr. By the way make sure you have a Flickr account and that you are logged in! Once sure of that, run the program: Code:
./download_from_flickr.pl If you did right, you should now have an authorization token! Edit the program: Code:
sudo gedit download_from_flickr.pl Code:
my $auth_token = ""; While you are here edit the line Code:
my $root_temp_dir = "/home/YourName/pictures/"; Now we're about to download some images! You'll have to find out what to download - take a look in the comments section of the program (you didn't close gedit did you?). You can search for images by tags, sets, groups and the user who put up the image. Once you know a little about how the program works you can close gedit There's a nice group on Flickr where users can put images suited for wallpapers. It's called "Wallpaper group". To download the latest 60 images from this group, do this: Code:
./download_from_flickr.pl -u public -max 60 -size o -g 40961104@N00 "Wallpaper group" The funny number (40961104@N00) is the group-ID. I'm not sure what the best way to get this is. I do it this way: go to the main page of a group in Flickr. Hold the mouse over the RSS-feed link on the page and check the URL that is displayed in the status bar. Somewhere in the should be the group-id. If you want to download sets later on you'll need the set-id. For that you can use the same method. The last parameter is the subdirectory where the images will be downloaded to. This subdirectory is created in the root-directory you specified when you edited the program file. Do not store any other files in these subdirectories as they will be deleted when you run the program! Very good. Perhaps you would like to automatically change your wallpaper in Gnome? We'll use the included program for changing the wallpaper and create a cron job that schedules the program. Start by testing if the change_wallpaper program works. You'll need Python to run it: Code:
sudo apt-get install python Code:
gedit change_wallpaper.py Save the file and close gedit. Now run the program to test it: Code:
./change_wallpaper.py Now lets create the cron jobs. Cron jobs are used to schedule programs to run at certain times. We would like to download images from the Flickr Wallpaper group every day at 8pm and change the wallpaper every hour. I heard somewhere that cron is not installed by default with Dapper so make sure it's installed: Code:
sudo apt-get install cron Code:
crontab -e Code:
0 20 * * * FULLPATHTOPROGRAMS/download_from_flickr.pl -u public -max 60 -size o -g 40961104@N00 "Wallpaper group" >& /dev/null 0 * * * * python FULLPATHTOPROGRAMS/change_wallpaper.py >& /dev/null That's it! Now exit the crontab editor and wait I also use the download_from_flickr program to get images for the GLSlideshow screensaver - it works very well too! |
|
|
|
|
#2 |
|
First Cup of Ubuntu
![]() Join Date: May 2007
Beans: 2
|
Re: HOWTO: Use images from Flickr as wallpaper and screensaver
The script appears to only download one or two images properly and the rest are coming down as in image from flicker that says the image is not availible
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|