https://github.com/twowheeldev/markuptwitchstream
Processwire Module to show the status of Twitch Channel
https://github.com/twowheeldev/markuptwitchstream
processwire processwire-field processwire-modules twitch
Last synced: 16 days ago
JSON representation
Processwire Module to show the status of Twitch Channel
- Host: GitHub
- URL: https://github.com/twowheeldev/markuptwitchstream
- Owner: TwoWheelDev
- License: mit
- Created: 2025-04-21T11:08:37.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-04-28T19:27:13.000Z (25 days ago)
- Last Synced: 2025-05-07T20:17:49.775Z (16 days ago)
- Topics: processwire, processwire-field, processwire-modules, twitch
- Language: PHP
- Homepage:
- Size: 259 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ProcessWire Twitch Stream Markup
 
A custom Fieldtype and Inputfield for ProcessWire that allows you to store a Twitch username on a page and view its live stream status.
The module currently uses TailwindCSS for styling (but future versions may make the styles configurable).
## Features
- Stores a Twitch username in a field.
- Shows whether the user is currently live from the page editor.
- Uses Processwire cache for storage of Twitch OAuth Token.## Modules Included
- `FieldtypeTwitch`: Stores the Twitch username.
- `InputfieldTwitch`: Input field with live status preview in admin.
- `MarkupTwitchStream`: For rendering Twitch information on the frontend.## Screeenshots
 
 ---
## Installation
1. Copy the module files into a folder named `MarkupTwitchStream/` under `/site/modules/`.
2. Go to **Modules > Refresh** in the ProcessWire admin.
3. Install the `MarkupTwitchStream` module, this will also install:
- `InputfieldTwitch`
- `FieldtypeTwitch` (this will auto-install `InputfieldTwitch`)---
## Setup
1. Go to **Setup > Fields**, and create a new field using the **Twitch** fieldtype.
2. Add the field to a template (e.g., `profile`, `streamer`, etc.).
3. Edit a page using that template and enter the Twitch username.
4. Once saved, the field will show the user's live status directly in the admin UI.---
## Frontend
The render function takes two parameters, the current page and the name of the field containing the Twitch username
```php
/** @var TwitchStream $twitch */
$twitch = $modules->get('MarkupTwitchStream');
$twitch->render($page, "twitch");
```---
## Twitch API Credentials
You need a [Twitch developer application](https://dev.twitch.tv/console/apps) to use the API.
### Steps:
1. Create a new app on the Twitch Developer Console.
2. Set the OAuth Redirect URL (you won’t use it for this, but Twitch requires one).
3. Copy your **Client ID** and **Client Secret**.
4. Add them to the `MarkupTwitchStream` module configuration