YouTube new subscriber overlay

{If you found this place because you are a YouTube livestreamer and would like to use this but you do not have any programming knowledge or a server, feel free to contact me at meeusdylan [at] hotmail [dot] com.}

As people who watch livestreams will know, when you are viewing a stream on twitch and a new person subscribes to the person streaming, their name will pop-up on-screen during the livestream a few minutes after subscribing. YouTube started offering livestreaming quite some time ago, yet no such function exists at the time of this writing. After looking around how OBS does this in combination with Twitch, I decided to create this myself with PHP and Javascript.

It was not that difficult, and all the code is available here. If you know how to setup a server able to run PHP code, and change the MailClient details to your details, this will work for you. The username is the email-adress you have used for your YouTube account.

        $imapPath = '{}INBOX';
        $username = 'username';
        $password = 'password';

I hacked it together during the weekend so there are some rough edges here and there which will be filtered out later. But, it is working and is currently used by YouTube livestreamers. Considering that all the code is available on GitHub I will not delve into it further in this blogpost. It was a quick hack and doesn't do anything that special. It reads out your email every X minutes, checks for new subscribers emails, and pushes them on-screen with a fading effect. OBS' CLR browser is running this HTML page on the background and displays whatever is displayed on the page of which the colour is not 0x0f0 (Green). (It's like using a greenscreen for special effects in movies). If you were to alter the look of the message, just remember that green text will not be visible!

The code on github is free to use for anything you like, commercial or otherwise, just give a small attribution somewhere to the original source! 😉