Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voiddevsorg/social-alert
A simple package to get the latest video from a YouTube channel or the latest stream from a Twitch channel
https://github.com/voiddevsorg/social-alert
epic-games instagram reddit steam twitch twitter youtube
Last synced: 13 days ago
JSON representation
A simple package to get the latest video from a YouTube channel or the latest stream from a Twitch channel
- Host: GitHub
- URL: https://github.com/voiddevsorg/social-alert
- Owner: VoidDevsorg
- Created: 2023-06-03T23:25:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-18T23:38:30.000Z (about 1 year ago)
- Last Synced: 2024-10-13T02:31:53.231Z (24 days ago)
- Topics: epic-games, instagram, reddit, steam, twitch, twitter, youtube
- Language: TypeScript
- Homepage: https://npmjs.com/package/@voidpkg/social-alert
- Size: 18.6 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![icon](https://voidapi.rest/images/bFQmP1j/social-alert.png)
#
## Introduction
**Social Alert** package is a social media alert package that provides instant broadcast notification in applications such as Instagram and twitch.
With low latency, you can get information quickly when the broadcasts of the broadcasters start to broadcast, below is the user guide.
## Installation
```bash
npm i @voidpkg/social-alert --save
# or
yarn add @voidpkg/social-alert
```
# Usage
### **YouTube**
```ts
import { YouTube } from "@voidpkg/social-alert";const youtube = new YouTube({
channels: [ "CHANNEL_ID" ],
postedVideos: [],
interval: 10000
});youtube.addChannel('CHANNEL_ID');
youtube.on('upload', (video: Video) => {
console.log(video);
});
```### **Twitch**
```ts
import { Twitch } from "@voidpkg/social-alert";const twitch = new Twitch({
channels: ['elraenn'],
liveChannels: [],
interval: 10000,
client: {
id: '', // Get from: https://dev.twitch.tv
secret: '', // Get from: https://dev.twitch.tv
token: '' // After entering the ID and SECRET, run it and check your console, a token will be automatically generated for you. So you can leave this blank.
}
});twitch.addChannel('wtcn');
twitch.on('live', (stream: Stream) => {
console.log(channel);
});twitch.on('offline', (stream: Stream) => {
console.log(channel);
});
```
# API
## Providers
|Name|Events|Implemented|Return Interface|Import Name|
|---|---|---|---|---|
|Twitch|`live`, `offline`|✅|`Stream`|`Twitch`|
|YouTube|`upload`|✅|`Video`|`YouTube`|
|Instagram|`-`|❌|`-`|`Instagram`|
|Reddit|`-`|❌|`-`|`Reddit`|
|Twitter|`-`|❌|`-`|`Twitter`|
|Game Discounts|`-`|❌|`-`|`GameDiscounts`|
## Interfaces
```ts
Stream {
id: string;
user_id: string;
user_login: string;
user_name: string;
game_id: string;
game_name: string;
type: string;
title: string;
viewer_count: number;
started_at: string;
language: string;
thumbnail_url: string;
tag_ids: string[];
tags: string[];
is_mature: boolean;
}Video {
title: string;
link: string;
pubDate: string;
author: string;
id: string;
isoDate: string;
thumbnail: string;
description: string;
}
```
---