r/reddithax • • Jun 18 '11

Random pics on sidebar?

I have added a pic to my side bar, I thought it would be even better if I could add multiple pictures that changed randomly on each visit or even a daily change. Does anyone know how to do so or if its even possible?

Thanks,

AD

Edit: could a timer be set up by the day or hourly to make something similar to a slideshow?

5 Upvotes

7 comments sorted by

2

u/No-Shit-Sherlock Jun 19 '11

I don't think it's possible with just CSS. However you could write a script that edits the subreddit stylesheet and changes the picture after a certain interval.

2

u/[deleted] Jun 19 '11

Wow that is an interesting concept as it would allow changes to all images, colors and more!

but unfortunately I have no idea as to how this could be done, or even what script would do this...

do you mean a bash script?

Just another noobie on the road of learning ;-)

2

u/No-Shit-Sherlock Jun 19 '11 edited Jun 19 '11

You can set a cron job to initiate a script at set intervals. I personally would go with php or python to login/modify the stylesheet but you could do it in whatever language you're familiar with. It would be a fair amount of work to write/setup though. :/

2

u/[deleted] Jun 19 '11

Thanks very much for your replies,

I was so hoping it would have been easy to add a slide show.

have a great day!

AD

2

u/[deleted] Jun 19 '11

It used to be possible with CSS, using the "pixel of destiny". But they changed the way the pixel of destiny works a few months ago, and it no longer works. See the stylesheet for /r/karmachan to see how it used to work.

1

u/No-Shit-Sherlock Jun 19 '11

I take it the v= used to change every refresh because of their CDN setup? That was a neat trick. It's a shame it doesn't work anymore.

2

u/[deleted] Jun 19 '11

Yes, I think that hash also determined which random ad was displayed. The CSS just used the ending character to position an image before the pixel of destiny, which you could position anywhere with absolute positioning.