Users browsing this thread: 4 Guest(s)
JavaScript -> Auto-updating Image
#14
(11-08-2013, 04:28 PM)Phaze Wrote: I'm working on it now, just futzing about to get the current strip ID based on the current day compared to the day/strip ID I have stored in the script (the one for 08-11-2013) and then get the URL for that strip - it seems strips have this weird organizational thing about them, now:
http://dilbert.com/dyn/str_strip/0000000....strip.gif
The first digit of each of those is the same as the ID of the current strip - no date info. A weird organizational structure but I guess it works.

Once I have the URL capable of being computed I just grab the image via GD and output it from the script. I'll then just need to add in the thing to make sure the current cached strip ID isn't the same as the current ID before it goes to retrieve it again.

Actually, if you check out the JavaScript code I posted, you'll see that there's a date-based system to get the image from thedilbertstore.com. For example today's one is http://thedilbertstore.com/images/period...08dhct.jpg. It is a JPG, but that hardly matters in this case, and it's slightly larger than the one from the homepage.
You may have a fresh start any moment you choose, for this thing that we call "failure" is not the falling down, but the staying down. -Mary Pickford
Thanked by:


Messages In This Thread
JavaScript -> Auto-updating Image - by puggsoy - 11-06-2013, 03:51 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-08-2013, 10:58 AM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-08-2013, 04:28 PM
RE: JavaScript -> Auto-updating Image - by puggsoy - 11-08-2013, 05:49 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-08-2013, 02:38 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-08-2013, 08:48 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-09-2013, 07:18 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-09-2013, 10:32 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-09-2013, 10:56 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-09-2013, 11:16 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-10-2013, 01:38 AM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-10-2013, 10:58 AM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-10-2013, 03:04 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-10-2013, 06:37 PM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-11-2013, 02:03 AM
RE: JavaScript -> Auto-updating Image - by Phaze - 11-11-2013, 07:16 PM

Forum Jump: