Hello There, Guest!
View New Posts  |  View Today's Posts
[Project] [PHP] Twitch Status Banner

  • 0 Vote(s) - 0 Average

08-29-2014, 08:42 AM #1
Posts: 199 Threads:16 Joined: Sep 2013 Reputation: 19

[PHP] Twitch Status Banner
I'm at work, nothing's happening - it's time to present a small free time project of mine!

This time it's a Twitch Status Banner!

Example banners:

Note: The banners aren't transparent, just so happen to be (almost) the same color as the forum ;)

It's nothing too fancy: A rather simple PHP script communicating with the Twitch API and generating a png image.
Which channel the banner should be for is set by the GET variable 'user' (twitch_status.php?user=username)

Long titles are broken up into up to three lines using wordwrap(). It won't cut words in half unless a word is longer than a whole line. Thanks to using a monospaced font (Ubuntu, size 10) each line can hold exactly 53 characters.

wordwrap() can produce somewhat weird results with long words, I'm looking into automated hyphenation as well as using existing hyphens.

If the user has no profile image a default twitch icon will be used instead.

Source code is available in the VIP area over here. If you're not a VIP feel free to ask any questions in here :)
This post was last modified: 03-10-2015, 10:25 AM by Mazzn. Edit Reason: Fixed Spoilers ;)
Visit me at mazzn.net & blog.mazzn.net!
//This is very important :)


08-29-2014, 09:04 PM #2
Posts: 9,722 Threads:1,025 Joined: Jun 2011 Reputation: 76

RE: [PHP] Twitch Status Banner
Not bad, I had a more complex PHP signature before, but I decided to just stick with text in my signature instead. Although mine is transparent for the background.

This post was last modified: 08-29-2014, 09:04 PM by AceInfinity.

Microsoft MVP .NET Programming - (2012 - 2018)
Automation Programmer
 ▲ ▲

08-29-2014, 11:48 PM #3
Master of the IRCs!
Posts: 153 Threads:23 Joined: May 2012 Reputation: 11

RE: [PHP] Twitch Status Banner
Oh nice, forum sigs are always great to play with.. as you can tell, I put a bit of time into mine.. heh. I know a few people that use Twitch often, I'll have to show them this.

Forum Jump:

Possibly Related Threads...
Thread Author Replies Views Last Post
  status friends php 1912Dummy 4 2,399 02-28-2013, 06:06 PM
Last Post: KoBE

Users browsing this thread: 1 Guest(s)