diff options
| author | Pinapelz <donaldshan1@outlook.com> | 2023-07-02 13:01:07 -0700 |
|---|---|---|
| committer | Pinapelz <donaldshan1@outlook.com> | 2023-07-02 13:01:07 -0700 |
| commit | daf431e1b8438bdba2711387873351e2fae09bdd (patch) | |
| tree | cc3fd7d28bb4c80b2047657340575b259609db33 | |
| parent | 25141f6b458cba1ac8240b5bc2a7f4cf73274cab (diff) | |
fix: domain formatting issues (redirects)
| -rw-r--r-- | app.py | 2 | ||||
| -rw-r--r-- | html_builders/builder.py | 2 | ||||
| -rw-r--r-- | html_builders/tables.py | 4 | ||||
| -rw-r--r-- | sql_table_config.json | 2 | ||||
| -rw-r--r-- | templates/ranking.html | 2 |
5 files changed, 6 insertions, 6 deletions
@@ -1,7 +1,7 @@ """ Flask app for serving the static files """ -from flask import Flask, request, send_file, send_from_directory, jsonify, abort +from flask import Flask, send_file, send_from_directory, jsonify, abort from flask_cors import CORS app = Flask(__name__) diff --git a/html_builders/builder.py b/html_builders/builder.py index dea2e8c..fe84f11 100644 --- a/html_builders/builder.py +++ b/html_builders/builder.py @@ -66,7 +66,7 @@ def build_individual_page(server, CONFIG: dict, channel_data: str): "subscriber_trend": graphs.plot_subscriber_count_over_time(server, CONFIG["TABLES"]["historical"], gtitle = "Subscriber Count Over Time for " + channel_name, overrideQuery = f"SELECT name, subscriber_count, timestamp, channel_id FROM {CONFIG['TABLES']['historical']} WHERE channel_id = '{channel_id}' ORDER by timestamp DESC", markers = "lines+markers"), "divider": "Recent Subscriber Data:", "weekly_trend": graphs.plot_subscriber_count_over_time(server, CONFIG["TABLES"]["historical"], gtitle = "Weekly Subscriber Count Over Time for " + channel_name, overrideQuery = f"SELECT name, subscriber_count, timestamp, channel_id FROM {CONFIG['TABLES']['historical']} WHERE channel_id = '{channel_id}' AND timestamp >= DATE_SUB(NOW(), INTERVAL 7 DAY) ORDER by timestamp DESC", markers = "lines+markers"), - "full_table_url": CONFIG["WEBSITE"]["homepage"] + "/tables/"+channel_name + "full_table_url": "/tables/"+channel_name } output = template.render(input_dict) with open(page_path, "w", encoding="utf-8") as f: diff --git a/html_builders/tables.py b/html_builders/tables.py index 87d2b4a..6c35382 100644 --- a/html_builders/tables.py +++ b/html_builders/tables.py @@ -1,4 +1,4 @@ -def generate_html_table(server, table, diff_table, headers=["Rank", "Liver", "Subscriber", "Difference (24hr)"], root_url="https://www.nijitracker.com"): +def generate_html_table(server, table, diff_table, headers=["Rank", "Liver", "Subscriber", "Difference (24hr)"]): def get_daily_difference_subs(sub_count_str: str): diff_cursor = server.get_connection().cursor() diff_cursor.execute(query) @@ -26,7 +26,7 @@ def generate_html_table(server, table, diff_table, headers=["Rank", "Liver", "Su rank += 1 for i, col in enumerate(row): if cursor.description[i][0] == "name": - channel_url = f"{root_url}/stats/{row[2]}" + channel_url = f"/stats/{row[2]}" profile_pic_url = row[5] table_row += f"<td><a href='{channel_url}'><img src='{profile_pic_url}' height='50px' width='50px'>{col}</a></td>" elif cursor.description[i][0] == "subscriber_count": diff --git a/sql_table_config.json b/sql_table_config.json index 7aea426..0e2e6e5 100644 --- a/sql_table_config.json +++ b/sql_table_config.json @@ -3,5 +3,5 @@ "LIVE_HEADER": "channel_id, profile_pic, name, subscriber_count, timestamp", "DAILY_COLUMNS": "id INT PRIMARY KEY AUTO_INCREMENT, channel_id VARCHAR(255), sub_diff INT", "DAILY_HEADER": "channel_id, sub_diff", - "HOLODEX_ORGS": "Phase%20Connect" + "HOLODEX_ORGS": "Nijisanji" } diff --git a/templates/ranking.html b/templates/ranking.html index 773c041..ff89fd5 100644 --- a/templates/ranking.html +++ b/templates/ranking.html @@ -219,7 +219,7 @@ <p style="text-align: center">{{footer}}</p> </div> <div style="text-align: center; margin-top: 20px"> - <a href="https://github.com/pinapelz/NijiTrack" target="_blank"> + <a href="/" target="_blank"> <img src="https://img.shields.io/github/license/pinapelz/NijiTrack?color=%23994CC3&style=flat-square" alt="License" |
