How sloganizer changes the sig image each time it's reloaded

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

How sloganizer changes the sig image each time it's reloaded

Postby leke » Sun Apr 11, 2010 2:15 pm

A few of us are using sloganizer in our sig (check out mine)

I've just coded (ok just finishing) my own version which will change the image every time the page (a python script) is called. I can't figure out how sloganizer knows how to change the users slogan image each time it is requested in the sig?

Any ideas?
Thanks.
User avatar
leke
LXF regular
 
Posts: 506
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby ollie » Mon Apr 12, 2010 3:02 am

Sloganizer uses a PHP script to connect to the Sloganizer server and write the slogan.
Code: Select all
<?php readfile("http://www.sloganizer.net/en/outbound.php?slogan=Sloganizer"); ?>

PHP code is processed every time a page is sent from the server, just like these forums using phpBB.
User avatar
ollie
Moderator
 
Posts: 2749
Joined: Mon Jul 25, 2005 11:26 am
Location: Bathurst NSW Australia

Postby leke » Mon Apr 12, 2010 5:39 pm

I'm not sure if I understand about what you said there, but that's ok, I'm pretty dumb.
The sig url in this forum is http://www.sloganizer.net/en/image,not- ... ,black.png which fetches the image. I been investigating though and I think those comma seperated strings are values passed to the script that looks like a .png image, but is in fact, a script (for example, php). I hear you can add something to the web server that passes whatever extension you want to run like it was a script. I guess you can return some kind of image stream back as the file request.

Some links about it:
http://www.scriptygoddess.com/archives/ ... hp-script/
http://stackoverflow.com/questions/1986 ... s-in-a-url

The other thing I can think of is that it's just a cron job executing the script every 15secs or so :D
User avatar
leke
LXF regular
 
Posts: 506
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland

Postby ollie » Wed Apr 14, 2010 11:32 am

OK, Sloganizer.net use a BBCode style URL to call the PNG image file:
Code: Select all
[url=http://www.sloganizer.net/en/][img]http://www.sloganizer.net/en/image,Sloganizer,white,black.png[/img][/url]

On the Sloganizer.net server they just put a new PNG file every so often with a new slogan, or that URL calls a script on their server that generates a new PNG file that is sent back for each request. How often do the "slogans" change?
User avatar
ollie
Moderator
 
Posts: 2749
Joined: Mon Jul 25, 2005 11:26 am
Location: Bathurst NSW Australia

Postby leke » Wed Apr 14, 2010 2:34 pm

ollie wrote:OK, Sloganizer.net use a BBCode style URL to call the PNG image file:
Code: Select all
[url=http://www.sloganizer.net/en/][img]http://www.sloganizer.net/en/image,Sloganizer,white,black.png[/img][/url]

On the Sloganizer.net server they just put a new PNG file every so often with a new slogan, or that URL calls a script on their server that generates a new PNG file that is sent back for each request. How often do the "slogans" change?
Yep, I did some refreshing of the page and it looks like it changes every 30 secs or so. It would look like a cron job that uses values in the .png url.
The first part [url=http://www.sloganizer.net/en/] is not influenced by the script since I have it linked to my website instead.
User avatar
leke
LXF regular
 
Posts: 506
Joined: Mon Oct 22, 2007 5:45 pm
Location: Oulu, Finland


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron