You are not logged in.

#1 2010-01-11 08:54:44

rggjan
Member
Registered: 2007-01-06
Posts: 69

IMPloader - Dynamic cinema poster wallpaper generator

Hi there! I just created a small script that fetches the posters of the top ten cinema movies from the internet, and then creates a dynamic wallpaper that looks like this:

ZqUjI.jpg

TS7pA.jpg

BxvlH.jpg

Now I have this in a cronjob, and can always see on my desktop background, what movies are in the theaters at the time big_smile

If anyone is interested, I could upload the script and explain it... It' very dynamic, you can set the Layout, the size of the Wallpaper etc. yourself. cool

Offline

#2 2010-01-11 10:09:05

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 785
Website

Re: IMPloader - Dynamic cinema poster wallpaper generator

That looks great. Nice idea.

Offline

#3 2010-01-11 15:05:33

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: IMPloader - Dynamic cinema poster wallpaper generator

So where is the script? What's the point in this post without the actual script? smile


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#4 2010-01-11 15:25:48

rggjan
Member
Registered: 2007-01-06
Posts: 69

Re: IMPloader - Dynamic cinema poster wallpaper generator

*hehe*, ok, the point was, that describing how it works etc. was work I decided only to do if anyone actually was interested.

But I've done it now, anyway.

So, here it is: http://media.ubuntuusers.de/forum/attac … der.tar.gz

README is included, ruby, imagemagick and wget are the only dependencies.

Have fun!

Last edited by rggjan (2010-01-11 15:26:25)

Offline

#5 2010-01-11 17:05:48

keenerd
Trusted User (TU)
Registered: 2007-02-22
Posts: 647
Website

Re: IMPloader - Dynamic cinema poster wallpaper generator

I don't have Ruby, but I do like this.  Have a quick and dirty sh port.

#! /bin/sh

# Edit these:
TMPPATH="/tmp" # Path to save the wallpaper and temp files
STYLE=1    # Black=1, White=2, Polaroid=3
W=800      # Width of final image
H=480      # Height of final image
BORDERW=50 # Left/right border width
BORDERH=0  # Top/bottom border height

function get_random_names ()  # string int : string
{
    echo "$1" | shuf -n "$2" | xargs -n 1 basename
}

mkdir -p "$TMPPATH/posters"

tmp_html="$TMPPATH/posters/index.html"
wget http://www.impawards.com/ -q -O "$tmp_html"
urls=`sed 's/ /\n/g' "$tmp_html" | grep '/thumbs/' | sed 's/thumbs/posters/g' | sed 's/imp_//g' | sed 's|^|http://www.impawards.com|g'`

cd "$TMPPATH/posters"
echo "$urls" | xargs wget -nc -q  

case "$STYLE" in
    1)
        N=3
        M=1
        COLOR="black"
        IMGCOMMAND="-background $COLOR -border 2x2 -bordercolor white \
                    -geometry $(( (( $W - ( $BORDERW * 2 )) / $N) - 44 ))x$(( ( $H - ( $BORDERH * 2)) / $M - 44 ))+20+20 \
                    -monitor -tile $(( $N ))x$M $TMPPATH/collage_tmp.jpg"
        ;;
    2)
        N=3
        M=1
        COLOR="white"
        IMGCOMMAND="-shadow -geometry $(( (( W - ( $BORDERW * 2 )) / $N ) - 41 ))x$(( (( $H - ( $BORDERH * 2 )) / $M ) - 44 ))+20+20 \
                    -monitor -tile $(( N ))x$M $TMPPATH/collage_tmp.jpg"
        ;;
    3)
        N=5
        M=2
        COLOR="LightGray"
        IMGCOMMAND="-border 2x2 -background black +polaroid -background $COLOR \
                    -geometry $(( 46 + ( $W - ( $BORDERW * 2 )) / $N ))x$(( 46 + ( $H - ( $BORDERH * 2 )) / $M ))-25-25 \
                    -monitor -tile $(( N ))x$M $TMPPATH/collage_tmp.jpg"
        ;;
esac

cd "$TMPPATH/posters"
images=`get_random_names "$urls" $(( $N * $M ))`
montage $images $IMGCOMMAND

cd "$TMPPATH"
convert collage_tmp.jpg -background "$COLOR" -gravity center -extent "$W"x"$H"  collage.jpg
rm collage_tmp.jpg

edit: a bunch of tabs that should not have been

Last edited by keenerd (2010-01-11 17:11:47)

Offline

#6 2010-01-11 17:36:11

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,810
Website

Re: IMPloader - Dynamic cinema poster wallpaper generator

Interesting and spammy at the same time. tongue

Offline

#7 2010-01-12 17:06:55

rggjan
Member
Registered: 2007-01-06
Posts: 69

Re: IMPloader - Dynamic cinema poster wallpaper generator

@keenerd: Wow, that was fast wink

@Xyne: What do you mean with spammy?

Offline

#8 2010-01-12 17:10:16

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,810
Website

Re: IMPloader - Dynamic cinema poster wallpaper generator

rggjan wrote:

@Xyne: What do you mean with spammy?

Well, it's advertising directly on your desktop, which is a bit spammy... but if you like the movies, then it's interesting.

Offline

Board footer

Powered by FluxBB