Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesigned, organized features, added a lot #53

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4134161
Split up everything for easier record keeping
Yohn Feb 10, 2023
dfef6ab
Update package.json
Yohn Dec 8, 2023
e082df7
New, easier to read, BS5 dark themed layout with saving to google she…
Yohn Dec 19, 2023
dcacfb0
Merge branch 'Google-Sheets-DB' into old
Yohn Dec 19, 2023
bf283a0
sounds, and google sheets to store gifts database
Yohn Mar 16, 2024
3458269
Merge branch 'old' of https://github.com/Yohn/TikTok-Chat-Reader into…
Yohn Mar 16, 2024
da331a8
added sounds and moved datalist of usernames to json file
Yohn Mar 18, 2024
b5e5e2b
datalist prefiled
Yohn Mar 19, 2024
2a8d8dc
add / remove preselect usernames based on config.json
Yohn Mar 21, 2024
0f2ea94
offcanvas with modal for notes and adding / removing names for the da…
Yohn Mar 25, 2024
2fd72ed
sounds, and a couple updates
Yohn Mar 28, 2024
afb18f1
fixing settings panel
Yohn Apr 4, 2024
554234e
version
Yohn Apr 5, 2024
f937fac
screenshot
Yohn Apr 5, 2024
ac0c944
notes working, need to remove the delete button
Yohn Apr 10, 2024
cf48568
fixed notes
Yohn Apr 10, 2024
9c57084
settings panel improved
Yohn Apr 14, 2024
387b561
settings panel improved
Yohn Apr 14, 2024
e4bf8c3
removed Announcement for a custom sound playlist so gift sounds dont …
Yohn Apr 15, 2024
75b5699
updated sounds and tts
Yohn Apr 19, 2024
d618e9b
update server
Yohn Apr 22, 2024
8bae8c0
update readme
Yohn Apr 22, 2024
9f6a35e
Update README.md
Yohn Apr 22, 2024
bf7fc07
add bohr.yml workflow
Yohn Apr 24, 2024
5727f9c
update package.json
Yohn Apr 25, 2024
e089e53
Merge branch 'old' of https://github.com/Yohn/TikTok-Chat-Reader into…
Yohn Apr 25, 2024
5b49cb7
update live version
Yohn May 6, 2024
d96d81b
removed bohr since it didnt work
Yohn May 7, 2024
9c70d19
works with google cloud
Yohn May 8, 2024
ea26fd6
test nhost
Yohn May 12, 2024
ce598d4
update TTL version
Yohn May 28, 2024
67a2a9f
update
Yohn Sep 4, 2024
f700342
Rename config.example.json to config.json
Yohn Nov 2, 2024
dcfe9b7
Added idx.google.com auto build and launch config
Yohn Nov 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = tab
indent_size = 2
insert_final_newline = false
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GOOGLE_SHEET_ID=IS_FOUND_IN_URL_THAT_WAS_SHARED_TO_APP_EMAIL
17 changes: 17 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Node.js dependencies:
node_modules/
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
package-lock-old.json
public/tt-usernames.json

#Google Spreadsheet API Key File
keys.json

# Logs
logs
*.log
Expand Down Expand Up @@ -102,3 +108,13 @@ dist

# TernJS port file
.tern-port
/public/tt-usernames.json
/tt-usernames.js
/public/config.json
public/config.json
**/config.json
.vscode/TikTok-Chat-Reader.code-workspace

/public/test.html
toDoData.json
/public/config.json
55 changes: 55 additions & 0 deletions .idx/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"

# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
# pkgs.python311
# pkgs.python311Packages.pip
pkgs.nodejs_20
# pkgs.nodePackages.nodemon
];

# Sets environment variables in the workspace
env = {};
idx = {
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
extensions = [
# "vscodevim.vim"
];

# Enable previews
previews = {
enable = true;
previews = {
web = {
# Example: run "npm run dev" with PORT set to IDX's defined port for previews,
# and show it in IDX's web preview panel
command = ["node" "server.js"];
manager = "web";
env = {
# Environment variables to set for your server
PORT = "$PORT";
};
};
};
};

# Workspace lifecycle hooks
workspace = {
# Runs when a workspace is first created
onCreate = {
# Example: install JS dependencies from NPM
# npm-install = "npm install";
};
# Runs when the workspace is (re)started
onStart = {
# Example: start a background task to watch and re-build backend code
# watch-backend = "npm run watch-backend";
};
};
};
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"isGitignoreExtActive": true,
}
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# TikTok-Chat-Reader
A chat reader for <a href="https://www.tiktok.com/live">TikTok LIVE</a> utilizing <a href="https://github.com/zerodytrash/TikTok-Live-Connector">TikTok-Live-Connector</a> and <a href="https://socket.io/">Socket.IO</a> to forward the data to the client. This demo project uses the unofficial TikTok API to retrieve chat comments, gifts and other events from TikTok LIVE.

## Demo: https://tiktok-chat-reader.zerody.one/

# Easy Installation, no host needed!
> [!TIP]
> I recently found out about [IDX.Google.com](https://idx.google.com) which can host this package for free, for personal usage.

1. Fork this repo to your account.
2. Go to [IDX.Google.com](https://idx.google.com) - You'll probably have to sign in or connect your github account.
3. Open your forked project within the IDX Editor
4. It will auto launch the on the side like VSCode's built in previewer.

---

## Original Demo: https://tiktok-chat-reader.zerody.one/
^ That demo does not have the changes I've made. Please use the solution above using [idx.google.com](idx.google.com) to see this repo's capabilities.

## Installation
To run the chat reader locally, follow these steps:

1. Install [Node.js](https://nodejs.org/) on your system
2. Clone this repository or download and extract [this ZIP file](https://github.com/zerodytrash/TikTok-Chat-Reader/archive/refs/heads/main.zip)
2. Clone this repository or download and extract [this ZIP file](https://github.com/Yohn/TikTok-Chat-Reader/archive/refs/heads/old.zip)
3. Open a console/terminal in the root directory of the project
4. Enter `npm i` to install all required dependencies
4. Enter `npm i` to install all required dependencies
5. Enter `node server.js` to start the application server

Now you should see the following message: `Server running! Please visit http://localhost:8091`<br>
Expand All @@ -18,6 +31,37 @@ Simply open http://localhost:8091/ in your browser. Thats it.
If you have problems with Node.js, you can also just open the `index.html` from the `public` folder.<br>
This will use the server backend of the [demo site](https://tiktok-chat-reader.zerody.one/), which is sufficient for testing purposes. If you want to offer it to others or make many connections at the same time, please consider using your own server.

> [!NOTE]
> I recently found out about [IDX.Google.com](https://idx.google.com) and you're able to fork this repo then open this repo within Google's IDX editor and see this working on the side without needing to download, and without the need for a host, for personal usage.

## Yohn's Updates
- Separated everything away from the chat
- Likes (number is not correct
- New followers
- Shares
- When users under gifter level 25 join
- TTS - Text to Speech for comments (can be disabled)
- Different sounds for gifts (can be disabled)
- Best way to add / edit sounds is to add them to the config file
- A way to save gifts sent in live to a google spreadsheet.
- Will need to research yourself to add the `keys.json` file and to update your `.env` file
- [Medium post might be helpful](https://medium.com/@shkim04/beginner-guide-on-google-sheet-api-for-node-js-4c0b533b071a) might help
- Gifter badges
- Team Member badges
- Subscriber icon
- Moderator icon
- Battle scores, even for 2v2
- Sometimes the battle scores come back to the wrong hosts. This is because of how its received from the [TikTok-Live-Connector](https://github.com/zerodytrash/TikTok-Live-Connector)
- Battle timer
- Sometimes the times off by a second, possibly more if the time booster was used
- If the gift is sent to someone in the guest boxes it will note that in the box area
- If the receiver was not tapping, commenting or sending gifts since connecting the receiver will be blank.
- Names entered to connect to the persons live are saved within the config file (works automatically)
- Notes can be saved into the config file, or within the cog menu
- Host info
- Top 3 gifters before connecting to the live

## Screenshot

![TikTok LIVE Chat Reader (Demo)](https://user-images.githubusercontent.com/59258980/153956504-c585b14b-a50e-43f0-a994-64adcaface2e.png)
![Screenshot 1](https://github.com/Yohn/TikTok-Chat-Reader/assets/2002591/7584c463-8000-4e9e-b923-2e0c48106b18)
![image](https://github.com/Yohn/TikTok-Chat-Reader/assets/2002591/09805565-de42-42be-8600-09d80aaf3c5b)
2 changes: 2 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
runtime: nodejs18
service: default
13 changes: 13 additions & 0 deletions keys.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "appname",
"private_key_id": "some md5 or sha string",
"private_key": "-----BEGIN PRIVATE KEY-----\nA REALLY LONG STRING==\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "1234",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x123/appname%40appname.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
Loading