Squiso 是一款免费且功能强大的自动化工具,可让您使用简单的脚本自定义您的 Twitch 流。

How to Display the Number of Twitch Channel Subscribers in OBS Studio

This script example fetches the number of Twitch subscribers you have and writes it to a file every 15 minutes, which then can be displayed in OBS Studio using a Text Source in a Scene.

脚本示例

import com.squiso.*; import com.squiso.exception.*; import com.squiso.scripting.*; import com.squiso.scripting.data.*; import com.squiso.keyboard.*; import com.squiso.twitch.*; import com.squiso.datatypes.*; import com.squiso.utils.*; // Important - Please do not change the row below - otherwise you will get a compilation error! public class Script_Example extends SquisoScript { public void onEveryMinute(OnEveryMinuteData data, API api) throws SquisoException { // Do this every 15 minutes if (data.is(15)) { // Get the number of subscribers int nbrOfSubs = api.getTwitchChannelSubscribersCount(); // Compose the contents of the file SquisoString contents = new SquisoString("Number of subs: " + nbrOfSubs); // Write the file with the contents contents.writeToFile("subscribers.txt"); } } }