twitch-notifier
v1.1.4
Published
🔔 get email notifications whenever your favorite twitch streamers go live.
Downloads
4
Maintainers
Readme
:trumpet: Overview
Receive an email informing whenever your favorite twitch streamers go live.
I developed this solution because I think twitch way to handle notifications is not so optimized when you follow a lot of streamers, since you have to disable all the ones you don't want to receive notifications, rather than select only the streamers you want to get notified about.
So this tool allows me to disable all twitch notifications and get notified when my favorite streamers (razah and theprimeagen) go live.
:dart: Features
✔️ receive an email informing whenever your favorite streamers go live; ✔️ option set hours to not get notifications, like between 0-6 am; ✔️ set custom filtering words to ignore: skip notifications when the live title contains the word 'rerun'; ✔️ set custom filtering words to search: get notified only when the live title contains the word 'live'.
:warning: Requirements
The only thing you need to use this project is a gmail/google account
.
:bulb: Usage
How it works
It basically sets a function to run in google apps scripts to run everyday at a specified time, and this function is responsable for:
- visit each of your favorite streamers twitch link and store the information;
- fitler all the data to only remain the ones you should be notified about, considering your specified options;
- if there's at least one stream to notify you about, send an email containing the details.
Installation
To effectively use this project, do the following steps:
Updating
To update your twitch-notifier instance and use the latest features, you just need to change the version
number in the getTwitchNotifier
function, as it is shown bellow:
So if your instance is running at version "1.0.0" and the latest is "3.6.1", just replace those numbers in the version
variable.
It is a good practice to go to the dist folder everytime you update your instance to check if your files in GAS have same properties as the new version; if they're not this may cause errors.
Uninstall
If you want to receive the daily emails, just go to the GAS respective project in the header dropdown menu select the uninstall
function and then click on the Run
button. By doing that, the GAS trigger responsable for running everyday the function will be deleted.
:wrench: Development
Development setup
# Clone this repository
$ git clone https://github.com/lucasvtiradentes/twitch-notifier
# Go into the repository
$ cd twitch-notifier
# Install dependencies
$ npm install
If you want to contribute to the project, fork the project, make the necessary changes, and to test your work you can load your version in apps scripts with almost no effort do this: replace the content of the getTwitchNotifier function with the following code:
function getTwitchNotifier() {
// const version = "1.1.4" // version
// const content = getTwitchNotifierProduction(version)
const content = getTwitchNotifierDevelopment('yourgithub/project-fork', 'develop');
eval(content);
const twitchNotifier = new TwitchNotifier(CONFIGS);
return twitchNotifier;
}
function getTwitchNotifierProduction(version) {
return UrlFetchApp.fetch(`https://cdn.jsdelivr.net/npm/twitch-notifier@${version}`).getContentText();
}
function getTwitchNotifierDevelopment(repository, branch) {
const filePath = 'dist/TwitchNotifier.min.js';
const final_link = `https://api.github.com/repos/${repository}/contents/${filePath}${branch ? `?ref=${branch}` : ''}`;
const response = UrlFetchApp.fetch(final_link, { method: 'get', contentType: 'application/json' });
const base64Content = JSON.parse(response.toString()).content;
const decodedArr = Utilities.base64Decode(base64Content);
const decodedAsString = Utilities.newBlob(decodedArr).getDataAsString();
return decodedAsString;
}
This will allow you to select the twitch-notifier source place (github repository or npm package) and specify the intended version.
Used technologies
This project uses the following thechnologies:
:books: About
Related
- [x] esports-notifier: receive a daily email informing whenever at least one of your favorite esports teams has a match on the current date;
- [x] gcal-sync: sync your github commits and ticktick tasks to your google calendar and track your work effortlessly;
- [x] GAS docs: documentation related to triggering functions in Google Apps script.
License
This project is distributed under the terms of the MIT License Version 2.0. A complete version of the license is available in the LICENSE file in this repository. Any contribution made to this project will be licensed under the MIT License Version 2.0.
Feedback
If you have any questions or suggestions you are welcome to discuss it on github issues or, if you prefer, you can reach me in my social media provided bellow.