This Google Apps Script automates various tasks related to managing Twitch clips in a Google Sheets spreadsheet. It provides functionalities such as populating Twitch categories, identifying potential duplicate clips, filtering clips based on channels, identifying non-Twitch clips, and automated spreadsheet formatting.
- Populate Twitch Categories: Automatically retrieves and populates the categories for Twitch clips in the sheet.
- Identify Potential Duplicates: Identifies and flags potential duplicate Twitch clips based on video ID and VOD offset.
- Filter Channels: Identifies and flags clips from specific Twitch channels.
- Identify Non-Twitch Clips: Detects and flags clips that are not from Twitch.
- Fix Formatting: Applies consistent formatting to the sheet, including cell alignment, number formatting, and font styles.
- Run All Functions: Executes all the above functions in a single operation.
Before using this script, make sure you have the following:
- A Google Account with access to Google Sheets.
- Twitch API credentials (Client ID and Bearer Token) for making API requests.
- Open your Google Sheets spreadsheet.
- Go to "Extensions" > "Apps Script" to open the Google Apps Script editor.
- Copy and paste the provided code into the script editor. (Feel free to organize your Apps Script project however you want. All server-side files are loaded into a shared global namespace.)
- Create a new script property named
BEARER_TOKEN
and set its value to your Twitch API Bearer Token. - Create another script property named
CLIENT_ID
and set its value to your Twitch API Client ID. - Save the script and close the script editor.
- Open your Google Sheets spreadsheet.
- You will see a new menu named "Twitch Clips" in the menu bar.
- Click on the desired function from the "Twitch Clips" menu to execute it.
- The script will process the data in the sheet and update the relevant cells accordingly.
- You can modify the script to adapt it to your specific requirements.
- Make sure to update the
correctChannelId
variable in theisCorrectChannel
function with the desired broadcaster's ID. - Adjust the formatting styles in the
fixFormatting
andonFormSubmit
functions to match your preferred layout.
Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License.