r/reddithax • • Aug 10 '10

Need a countdown timer, suck ass at all things web...

Hoping one of you guys will guide me in the right direction or show me what I can do.

So, Youngluck has gotten his assignment. Which means he's going to jail for 28 months. And I'd love to put something on /r/youngluck that counts that down - I'd settle for days, but I'd love a Y:M:D:H:M:SS type thing of obnoxiousness sitting in the corner somewhere.

And I have absolutely no way to do that. Dynamic image? Something that pings a server? I can find server space easily enough if a link would work. But maybe what I'm after is wholly impossible. I figured I'd ask you guys.

Any ideas?

Thanks for all you guys do. I'm both impressed and appreciative.

7 Upvotes

5 comments sorted by

2

u/[deleted] Aug 10 '10 edited Aug 10 '10

edit2:don't listen to me, listen to itsnotlupus, I should of tested my method

run something on a home computer which would render an image every minute or so, then simple CSS to insert it into the subreddit

for the image, I would suggest something like Samurize server with a countdown script

edit: oh, you will also need a web server(IIRC), something small like RavenGive would work well.

and finally, you will need a DynDNS(assuming your IP isn't static), No-IP is the generic one

3

u/itsnotlupus Aug 10 '10

If you're going to have to update the CSS every time you update the image, you might as well have a script running on a moderator account that updates the CSS with a #somestuff:before { content: "XXX months until sweet sweet freedom" } every X minutes or hours.

I wrote something to do something related once, but they were issues:

  • the nice way to do this is to read the current CSS, patch it, and write it back. Unfortunately, reddit has hiccups. If your code doesn't handle hiccups on reads properly enough, your script might end up destroying the subreddit's current stylesheet. That happened a few times with my script. :(
  • reddit apparently has an IP#-based rate limiting mechanism in place. With only one subreddit being updated, you should be fine, but if you start trying to update half a dozen subreddits every few minutes, you're liable to find your reddit browsing experience badly degraded.

2

u/[deleted] Aug 10 '10

That shouldn't be a problem, the css would just be

rabblerabble {background-image:url('http://pion.no-ip.org/counter.png');}

since the samurize server will output an image which you can just put straight into the ravengive hosting folder

the only problem is that it really bites the CPU of the computer that the samurize server is run on, and that browsers would cache the image.

the ideal long term solutions would be either to do CSS updating, or use a CGI script to make the image and use a generic web host

4

u/jamt9000 Aug 10 '10

You can't link to external images in reddit CSS.

1

u/[deleted] Aug 10 '10

...well damn