Is there any way to use eg BetterTTV or FranzerFaceZ (FFZ) on a website other than twitch.tv to replace emotes?
I want to show onstream alerts on twitch (implemented via browser source). The messages sent often contain emotes like OMEGALUL or PogU.
I know I could download the images and replace the emotes in the string. That is already working. However, there are always some emotes missing (because I would need to implement them all).
So is there a way to use one of the emote replacement systems on a page other than twitch?
So eg this message
Hey PogU :)
should become
Hey <img src="...."> :)
I did not find any possibilities, but as there is at least for BetterTTV an option to implement the javascript file for there has to be a way.
Not what I initially intended, as this is limited to the emotes I downloaded, but my quick and dirty approach was (using Laravel - so pure php would be without helpers like
storage_pathordd):Caution: Those downloads take quite some time. So you will run into timeouts if you just run them with an eg 30s php timeout. So either start it from CLI or set the time limit to infinite (eg
set_time_limit(0);or in php.ini:max_execution_time = 0)Step 1: Download the emotes
Alternative #1: BTTV
Alternative #2: FFZ
1) Get FFZ image ids
2) Download the images in PHP
Step 2: Create the emotes dictionary
Now, that you have all those images stored in your storage path, we need to create a dictionary to look them up (as in this approach it is done via javascript).
Step 2: Replace emotes in messages
Like I said, quick and dirty. If you have time, you sure find a better approach. Maybe reverse-engineering the chrome extensions for replacement makes more sense ;)