Author Topic: Can I use my Flikr account for the screensaver?  (Read 19462 times)

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #15 on: December 28, 2008, 02:58:46 am »
OK, here are the steps to manually upgrade rubygems to 1.3.1:

Code: [Select]
sudo apt-get install rubygems
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar xvzf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo ruby setup.rb
sudo rm /usr/bin/gem
sudo ln /usr/bin/gem1.8 /usr/bin/gem

The first command is there just to pull in the dependencies.  If you already have gem installed you may skip it.

Now verify:

Code: [Select]
linuxmce@dcerouter:~$ gem --version
1.3.1

Now try to install flickrfetchr using the setup-linuxmce script.  I uninstalled the gems then ran the setup on my linuxmce box and it installed fine.

Please give me a confirmation that this solved your installation problem, then I'll patch the setup scripts.

Just a FYI, apparently debian team does not like gems as the dependencies are internal to the source (as they should be in a scripting language) and not externally controlled (as brain dead apt expects).  That's probably why kubuntu's version of rubygems is so dated.  I installed rubygems on my kubuntu (0804 upgraded to 0810) system and apt installed rubygems-0.9.4 (the release from 05/2007).

The ruby community strongly recommends the 1.3 version.

I don't have a clean installed 0810 at the moment.  If you want to see what version kubuntu 0810 has:

Code: [Select]
sudo apt-get install rubygems
gem --version

HTH,
Roy

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #16 on: December 28, 2008, 04:00:54 am »
Roy,
Thanks for the help so far, it looks like that enabled me to install commandline which then let me install flickrfetcher. However I am not sure if it completed the install take a look at these last few lines, is this what was supposed to happen?

Now to setup FlickrFetcher
cp: cannot stat `/home/linuxmce/.flickrfetchr.cache': No such file or directory
chown: cannot access `/root/.flickrfetchr.cache': No such file or directory

FlickrFetcher is installed for stand-alone usage.  You may want to read the config file ~/.flickrfetchr.conf and set up some download criteria to verify that you can actually fetch photos.  There are some examples in it that should get you up and running quickly.  Please refer to the README for replacing flickr.pl with FlickrFetchr on LinuxMCE systems.
linuxmce@dcerouter:~/flickrfetchr$




krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #17 on: December 28, 2008, 04:05:09 am »
I am guessing that it didn't install correctly as I was never prompted for my account info for Flickr

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #18 on: December 28, 2008, 07:04:26 am »
you should be good to go.  Just run

Code: [Select]
flickrfetchr.rb

It's during the first time that the script is ran that you are prompted to authenticate with flickr.  BTW that is what creates the .cache files that are then used for future authentication.

After running it the first time, locate the .flickrfetchr.conf files, there should be three:

Code: [Select]
/root/.flickrfetchr.conf
/home/linuxmce/.flickrfetchr.conf
/etc/flickrfetchr.conf

Here's the logic for the multiple conf files. 

The /home/linuxmce/.flickrfetchr.conf is the one used when you run the script as the linuxmce user.  I use it to pull my photos from flickr to the linuxmce system (actually on my NAS so whole house has access).

The /root/.flickrfetchr.conf is the one used by the root user, for example if you want to set it up as a cron job.

The /etc/flickrfetchr.conf is the one used when you integrate flickrfetchr into the linuxmce (i.e., replace flickr.pl).

It's actually a little more complex than that.  The actual flow is to load the /etc/flickrfetchr.conf then merge ~/.flickrfetchr.conf.

There was a practical rational for this loading weirdness when I wrote it, but don't recall exactly what it was.  Maybe it should be simplified.

HTH,
Roy

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #19 on: December 28, 2008, 07:44:10 pm »
okay, I think I finally got this thing set up. I authorized FF using that link, and changed
    /usr/pluto/bin/flickr.pl
   
  to:
 
    /usr/local/bin/flickrfetchr.rb
Added some photos to my flickr account and now I will wait 24hrs and see if anything actually happens....
btw whats the path that flickrfetchr saves the photos to on the core?

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #20 on: December 29, 2008, 07:29:31 am »
LinuxMCE expects the photos to be stored under /home/flickr.  Note, it is ok to have sub-directories there.

This is configured in the flickrfetchr.conf file.

Here's part of my /etc/flickrfetchr.conf file.  You might want to cut and paste to give you a starting point:

# this pretty much matches the criteria that the default flickr.pl uses
LINUXMCE_1024_X_768_CRITERIA = {
                    :limit => 100,
                    :daycount => 5,
                    :destination_path => '/home/flickr',
                    :destination_naming => :short,
                    :plugins => [:LinuxMCE_Plugin],
                    :image_acceptable_types => ['jpg'],
                    :image_width_range => 600..1920,
                    :image_height_range => 600..1080,
                    :image_resize_to => {:width => 1024, :height => 768}
                  }

# some flickr group IDs
TOP20AVIATION_ID = '60512572@N00'
TOP20FISHEYE_ID = '46819026@N00'
TOP20LONGEXPOSURE_ID = '54941127@N00'

# lets put the top20 groups into a top20 LinuxMCE subdirectory
TOP20_CRITERIA = LINUXMCE_1024_X_768_CRITERIA.merge({
                    :destination_path => '/home/flickr/top20',
                    :limit => 20
                  })

# now let's create the group criteria for the top20 groups
TOP20AVIATION_GROUP_CRITERIA = TOP20_CRITERIA.merge({
                    :nsid => TOP20AVIATION_ID,
                  })

TOP20FISHEYE_GROUP_CRITERIA = TOP20_CRITERIA.merge({
                    :nsid => TOP20FISHEYE_ID,
                  })

TOP20LONGEXPOSURE_GROUP_CRITERIA = TOP20_CRITERIA.merge({
                    :nsid => TOP20LONGEXPOSURE_ID,
                  })

# finally lets specify which groups we want.
config[:GROUPS] = [
        TOP20AVIATION_GROUP_CRITERIA,
        TOP20FISHEYE_GROUP_CRITERIA,
        TOP20LONGEXPOSURE_GROUP_CRITERIA
]

Note, you can "force" an update to test the config file by simply running flickrfetchr.rb as root:

Code: [Select]
sudo flickrfetchr.rb --verbose

You should see something like:

Code: [Select]
linuxmce@dcerouter:/home/flickr$ sudo flickrfetchr.rb --verbose
[sudo] password for linuxmce:
 INFO flickrfetchr: Loading /etc/flickrfetchr.conf
 INFO flickrfetchr: Loading /home/linuxmce/.flickrfetchr.conf
 INFO flickrfetchr: Loading LinuxMCE_Plugin (require "flickrfetchr-linuxmce.rb")
 INFO flickrfetchr: Downloading photos from GROUPS ({:destination_naming=>:short, :image_width_range=>600..1920, :image_acceptable_types=>["jpg"], :limit=>20, :destination_path=>"/home/flickr/aircraft", :nsid=>"79204191@N00", :image_height_range=>600..1080, :image_resize_to=>{:width=>1920, :height=>1080}, :plugins=>[:LinuxMCE_Plugin], :image_fill_to=>{:width=>1920, :height=>1080}, :daycount=>5})
 INFO flickrfetchr: downloading http://farm4.static.flickr.com/3220/3144058266_2e6c2f4cc8_o.jpg to /home/flickr/aircraft/3144058266.jpg
 INFO flickrfetchr: downloading http://farm4.static.flickr.com/3127/3145331668_6c0860f186_o.jpg to /home/flickr/aircraft/3145331668.jpg
 INFO flickrfetchr: Skipping 2642314900 => [/home/flickr/top20/2642314900.jpg.tnj]
...
 INFO flickrfetchr: Cleanup LinuxMCE flickr images
 INFO flickrfetchr: Limiting to 200 flickr images
 INFO flickrfetchr: Cleanup completed

HTH,
Roy

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #21 on: December 29, 2008, 11:19:32 pm »
great, thanks again. I will give this a try tonight when I get home.

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #22 on: December 30, 2008, 06:41:40 am »
I added a simple line to the config file

config[:USERS] += [{:username => 'hlt1611'}]

and this is what i got when I tried to force an update

dcerouter_97913:/home/linuxmce# flickrfetchr.rb --verbose
 INFO flickrfetchr: Loading /etc/flickrfetchr.conf
 INFO flickrfetchr: Loading /root/.flickrfetchr.conf
 INFO flickrfetchr: Downloading photos from USERS ({:username=>"hlt1611"})
 WARN flickrfetchr: Unable to save file  - can't convert nil into String (attempt: 0)
 WARN flickrfetchr: Unable to save file  - can't convert nil into String (attempt: 1)
 WARN flickrfetchr: Unable to save file  - can't convert nil into String (attempt: 2)
 WARN flickrfetchr: Unable to save file  - can't convert nil into String (attempt: 3)
 WARN flickrfetchr: exit

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #23 on: December 30, 2008, 09:03:11 am »
You tickled a bug, thank you. 

For now, you can work around it by specifying a :destination_path.  For example:

Code: [Select]
config[:USERS] += [{:username => 'hlt1611', :destination_path => '.'}]

I'll patch the bug tomorrow when I'm more alert (it's bed time).

Thank you,
Roy

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #24 on: December 30, 2008, 03:26:39 pm »
Hey no problem, thanks for the sweet program. (assuming I get it running at some point ;D)

Witzman

  • Regular Poster
  • **
  • Posts: 15
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #25 on: December 30, 2008, 10:27:03 pm »
Hi,

i also managed to run the script via sudo and it is fetching pictures.

but if i cleanup the flickr folder manually, putting the flickrfetchr.rb script (/usr/local/bin/flickrfetchr.rb) into the field in the admin website and reboot the system, LMCE starts up but dont fetch any pictures. Why the scrip wont get started???

Also i am confused with the config file.

How can i define following settings.

Scenario 1
Get a bunch of pictures (500+) for tag 'aviation' in a 1024 resolution
(like these: http://flickr.com/search/?q=aviation)

Scenario 2
Combine diffrent tags.
Example: 500+ avaition pics, 500+ beach pics, 500+ flowers pics

Scenario 3
Totally random pics updated continuesly.
about 50 New pictures per hour - never delete old ones.

I dont want to use them parallel or on diffrent MD's - i just want these examples to understand the config.

Can you please help me with the config here?
« Last Edit: December 30, 2008, 11:58:30 pm by Witzman »

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #26 on: December 30, 2008, 11:53:02 pm »
I was just thinking how cool it would be if different MD's could run different slideshows (not sure if its possible). Like the MD in my garage running a slide show consists of downloads of muscle cars and guy stuff, while the Family room is running pictures from our personal photos on our flickr account, and the kids room is running pictures of cartoons and kid stuff (dont have any kids so maybe not the expert).
As far as I can tell there isnt currently a way to do this as all the orbiters get there pictures from the same location but it might be a cool idea for future developement.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #27 on: December 31, 2008, 03:29:00 am »
This could be added as an aspect of the Orbiter plugin, by adding a new devicedata for a given room, and passing that back to get the list of pictures for that room.. We would just need to separate picture fetching process a bit.

Per user wouldn't be so easy.

-Thom

krys

  • Addicted
  • *
  • Posts: 583
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #28 on: December 31, 2008, 07:18:34 am »
Good news bad news, I set the location for the script to save the files to and ran FF.rb the program went to flickr and grabbed my photos as it was supposed to. It saved them in the folder that I instructed it to, however when the screensaver runs, it is just a blank white screen. I assume it has something to do with the size of the images or resolution etc, the only thing i have in the config file is
 config[:USERS] += [{:username => 'hlt1611', :destination_path => '/home/flickr/muffin'}]

am I correct in my assumption? I can see the images just fine from my web 366 orbiter when I go to photos

royw

  • Guru
  • ****
  • Posts: 261
    • View Profile
Re: Can I use my Flikr account for the screensaver?
« Reply #29 on: December 31, 2008, 09:51:20 am »
When used for flickr.pl replacement on LinuxMCE, you have to specify the plugin in your config:

  :plugins => [:LinuxMCE_Plugin]

This tells flickrfetchr to hook into the LinuxMCE database.

In your example, I would use this config:

Code: [Select]
LINUXMCE_1024_X_768_CRITERIA = {
                    :limit => 100,
                    :daycount => 5,
                    :destination_path => '/home/flickr',
                    :destination_naming => :short,
                    :plugins => [:LinuxMCE_Plugin],
                    :image_acceptable_types => ['jpg'],
                    :image_resize_to => {:width => 1024, :height => 768}
                  }

MUFFIN_CRITERIA = LINUXMCE_1024_X_768_CRITERIA.merge({
                    :username => 'hlt1611',
                    :destination_path => '/home/flickr/muffin'
                  })

config[:USERS] += [MUFFIN_CRITERIA]


Witzman, I have a long answer just about ready, but flickr.com isn't responding for me to verify it at the moment.

HTH,
Roy