Dynamic Files - JimmyAppelt/snaz GitHub Wiki
Table of Contents
Signature
| Name | Content/Outputs |
|---|---|
| Filename | the name of the file that will be generated in the ~/DynamicTextFiles folder |
| Path | the path to request the content from |
| Content/Response | the response from the path |
| Type | the type of response you expect, ether Text or an Image |
| Status | report updates, completed, failed statuses |
Examples
IMPORTANT: Since August 2016, a Client-Id is required to send request. The examples on this page don't demonstrate that
Text Type
- A file that we will call
Game - Type = Text
- A
game_direct.phpfile that is on a server with the next contents. In this case we will add an extra value?channel=XXXto the path. WhereXXXwill be the channel name you want the data from.
<?php
$channel = $_GET['channel'];
$data = json_decode(@file_get_contents('https://api.twitch.tv/kraken/channels/' . $channel), true);
$game = $data['game'];
if($game != null){
echo $game;
//echo "Game: " . $game;
}
else{
echo " ";
}
?>

Response:

Image Type
- A file that we will call
ImageName - Type = Image
- A
myimage.phpfile that is on a server with the next contents
<?php
echo "http://ttv-backgroundart.s3.amazonaws.com/404_backgroundart.jpg";
?>

Response:

Specific notes
- Files can be any
http://orhttps://call, as long as it returns text or an image link - Possibilities are endless and up to you, since this module acts as a plugin hoster to write text- and image files for you