Skip to content

Commit 776b148

Browse files
author
Fahri Meral
committed
Merge pull request zerodytrash#53 from upstream
2 parents a811030 + dea5a0e commit 776b148

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5902
-1323
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = tab
7+
indent_size = 2
8+
insert_final_newline = false
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
GOOGLE_SHEET_ID=IS_FOUND_IN_URL_THAT_WAS_SHARED_TO_APP_EMAIL

.gcloudignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file specifies files that are *not* uploaded to Google Cloud
2+
# using gcloud. It follows the same syntax as .gitignore, with the addition of
3+
# "#!include" directives (which insert the entries of the given .gitignore-style
4+
# file at that point).
5+
#
6+
# For more information, run:
7+
# $ gcloud topic gcloudignore
8+
#
9+
.gcloudignore
10+
# If you would like to upload your .git directory, .gitignore file or files
11+
# from your .gitignore file, remove the corresponding line
12+
# below:
13+
.git
14+
.gitignore
15+
16+
# Node.js dependencies:
17+
node_modules/

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
package-lock-old.json
2+
public/tt-usernames.json
3+
4+
#Google Spreadsheet API Key File
5+
keys.json
6+
17
# Logs
28
logs
39
*.log
@@ -102,3 +108,13 @@ dist
102108

103109
# TernJS port file
104110
.tern-port
111+
/public/tt-usernames.json
112+
/tt-usernames.js
113+
/public/config.json
114+
public/config.json
115+
**/config.json
116+
.vscode/TikTok-Chat-Reader.code-workspace
117+
118+
/public/test.html
119+
toDoData.json
120+
/public/config.json

.idx/dev.nix

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# To learn more about how to use Nix to configure your environment
2+
# see: https://developers.google.com/idx/guides/customize-idx-env
3+
{ pkgs, ... }: {
4+
# Which nixpkgs channel to use.
5+
channel = "stable-23.11"; # or "unstable"
6+
7+
# Use https://search.nixos.org/packages to find packages
8+
packages = [
9+
# pkgs.go
10+
# pkgs.python311
11+
# pkgs.python311Packages.pip
12+
pkgs.nodejs_20
13+
# pkgs.nodePackages.nodemon
14+
];
15+
16+
# Sets environment variables in the workspace
17+
env = {};
18+
idx = {
19+
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
20+
extensions = [
21+
# "vscodevim.vim"
22+
];
23+
24+
# Enable previews
25+
previews = {
26+
enable = true;
27+
previews = {
28+
web = {
29+
# Example: run "npm run dev" with PORT set to IDX's defined port for previews,
30+
# and show it in IDX's web preview panel
31+
command = ["node" "server.js"];
32+
manager = "web";
33+
env = {
34+
# Environment variables to set for your server
35+
PORT = "$PORT";
36+
};
37+
};
38+
};
39+
};
40+
41+
# Workspace lifecycle hooks
42+
workspace = {
43+
# Runs when a workspace is first created
44+
onCreate = {
45+
npm-install = "npm install";
46+
};
47+
# Runs when the workspace is (re)started
48+
onStart = {
49+
# Example: start a background task to watch and re-build backend code
50+
# watch-backend = "npm run watch-backend";
51+
};
52+
};
53+
};
54+
}

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"isGitignoreExtActive": true,
3+
"IDX.aI.enableInlineCompletion": true,
4+
"IDX.aI.enableCodebaseIndexing": true,
5+
"terminal.integrated.hideOnStartup": "always",
6+
"workbench.editor.restoreViewState": false,
7+
"explorer.autoReveal": false,
8+
"security.workspace.trust.startupPrompt": "never",
9+
}

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# TikTok-Chat-Reader
22
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.
33

4-
## Demo: https://tiktok-chat-reader.zerody.one/
4+
5+
# Easy Installation, no host needed!
6+
> [!TIP]
7+
> I recently found out about [IDX.Google.com](https://idx.google.com) which can host this package for free, for personal usage.
8+
9+
1. Fork this repo to your account.
10+
2. Go to [IDX.Google.com](https://idx.google.com) - You'll probably have to sign in or connect your github account.
11+
3. Open your forked project within the IDX Editor
12+
4. It will auto launch the on the side like VSCode's built in previewer.
13+
14+
---
15+
16+
## Original Demo: https://tiktok-chat-reader.zerody.one/
17+
^ 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.
518

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

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

1528
Now you should see the following message: `Server running! Please visit http://localhost:8091`<br>
@@ -18,6 +31,37 @@ Simply open http://localhost:8091/ in your browser. Thats it.
1831
If you have problems with Node.js, you can also just open the `index.html` from the `public` folder.<br>
1932
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.
2033

34+
> [!NOTE]
35+
> 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.
36+
37+
## Yohn's Updates
38+
- Separated everything away from the chat
39+
- Likes (number is not correct
40+
- New followers
41+
- Shares
42+
- When users under gifter level 25 join
43+
- TTS - Text to Speech for comments (can be disabled)
44+
- Different sounds for gifts (can be disabled)
45+
- Best way to add / edit sounds is to add them to the config file
46+
- A way to save gifts sent in live to a google spreadsheet.
47+
- Will need to research yourself to add the `keys.json` file and to update your `.env` file
48+
- [Medium post might be helpful](https://medium.com/@shkim04/beginner-guide-on-google-sheet-api-for-node-js-4c0b533b071a) might help
49+
- Gifter badges
50+
- Team Member badges
51+
- Subscriber icon
52+
- Moderator icon
53+
- Battle scores, even for 2v2
54+
- 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)
55+
- Battle timer
56+
- Sometimes the times off by a second, possibly more if the time booster was used
57+
- If the gift is sent to someone in the guest boxes it will note that in the box area
58+
- If the receiver was not tapping, commenting or sending gifts since connecting the receiver will be blank.
59+
- Names entered to connect to the persons live are saved within the config file (works automatically)
60+
- Notes can be saved into the config file, or within the cog menu
61+
- Host info
62+
- Top 3 gifters before connecting to the live
63+
2164
## Screenshot
2265

23-
![TikTok LIVE Chat Reader (Demo)](https://user-images.githubusercontent.com/59258980/153956504-c585b14b-a50e-43f0-a994-64adcaface2e.png)
66+
![Screenshot 1](https://github.com/Yohn/TikTok-Chat-Reader/assets/2002591/7584c463-8000-4e9e-b923-2e0c48106b18)
67+
![image](https://github.com/Yohn/TikTok-Chat-Reader/assets/2002591/09805565-de42-42be-8600-09d80aaf3c5b)

app.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
runtime: nodejs18
2+
service: default

keys.example.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"type": "service_account",
3+
"project_id": "appname",
4+
"private_key_id": "some md5 or sha string",
5+
"private_key": "-----BEGIN PRIVATE KEY-----\nA REALLY LONG STRING==\n-----END PRIVATE KEY-----\n",
6+
"client_email": "[email protected]",
7+
"client_id": "1234",
8+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
9+
"token_uri": "https://oauth2.googleapis.com/token",
10+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x123/appname%40appname.gserviceaccount.com",
12+
"universe_domain": "googleapis.com"
13+
}

0 commit comments

Comments
 (0)