automated terminal push

This commit is contained in:
Your Name
2025-02-06 12:51:43 -05:00
parent 1c87bf5906
commit 9a787b2a58
18 changed files with 772 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
# API
http://localhost:8888/twitch/channel/truncate
## load the top 1000
go get 50x rankings, 20 times. truncates before all operations.
localhost:8888/twitchtracker.com/channel/load/
##
http://localhost:8888/twitchtracker.com/channel/load/2
load page two of the rankings

View File

@@ -0,0 +1,65 @@
# TwitchTrackerStubController API Documentation
This document outlines the functionalities provided by the `TwitchTrackerStubController` class.
**Note:** This API provides stubbed data, meaning it simulates real data from `twitchtracker.com` but doesn't interact with the actual website.
**Base URL:** `http://localhost:8888/twitchtracker.com/channel/stub`
**CORS:** Enabled
### Endpoints
#### 1. GET /rankings
* **Description:** This endpoint retrieves a single page (50 channels) of stubbed Twitch channel rankings data.
* **Response:** String containing HTML data representing the rankings table.
**Example Usage:**
```
GET http://localhost:8888/twitchtracker.com/channel/stub/rankings
```
#### 2. GET /load/
* **Description:** This endpoint fetches and returns a list of 1000 stubbed Twitch channels with their rankings.
* **Response:** List of `TwitchChannel` objects containing channel information.
**Example Usage:**
```
GET http://localhost:8888/twitchtracker.com/channel/stub/load/
```
**Implementation Details:**
* This endpoint calculates the number of pages required to retrieve 1000 channels based on the `channelsPerTwitchTrackerPage` constant (default 50).
* It then iterates through each page number and calls the `loadSingleTwitchTrackerPageByNumber` endpoint to retrieve the data.
* Finally, it combines all retrieved channels into a single list and returns it.
#### 3. GET /load/{pageNumber}
* **Description:** This endpoint retrieves a single page (50 channels) of stubbed Twitch channel rankings data based on the provided page number.
* **Path Variable:** `pageNumber` (integer) - Specifies the desired page number.
* **Response:** List of `TwitchChannel` objects containing channel information for the requested page.
**Example Usage:**
```
GET http://localhost:8888/twitchtracker.com/channel/stub/load/2
```
**Implementation Details:**
* This endpoint fetches a single page of stubbed HTML data representing the rankings table.
* It then parses the HTML and converts it into a list of `TwitchChannel` objects using the `twitchTrackerService.convert_html_list_twitch_channels` method.
* Finally, it saves each retrieved channel to the database using the `twitchChannelService.save` method. (This behavior might be specific to your application's use case.)
**Additional Notes:**
* The `sleepRandomly` method introduces a random delay between page fetches to simulate realistic network behavior.
* This documentation assumes familiarity with Spring annotations like `@GetMapping`, `@PathVariable`, and `@Autowired`.

40
docs/golive.md Normal file
View File

@@ -0,0 +1,40 @@
1. log in to linux server
2. clone repository
```
https://code.softwareshinobi.digital/yankee/twitchtracker-channel-rankings.git
``
3. go into directory
4.
docker compose.bash
it is assumed you already have docker installerd.
so then run
```
sudo bash provision.bash
```
## load the fake data to spec first
http://aventador.embanet.softwareshinobi.digital:48888/twitchtracker.com/channel/stub/load/
## populate the sql query to load the view
## database loging
phpmyadmin, lets you manage shit inside the db.
url :
user:
pass:

17
docs/index.md Normal file
View File

@@ -0,0 +1,17 @@
# Welcome to MkDocs
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
## Commands
* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
## Project layout
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.

9
docs/license.md Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

25
docs/view.sql.md Normal file
View File

@@ -0,0 +1,25 @@
# the view for custom reporting
## Create the View
```
## Drop the view
DROP VIEW IF EXISTS report_twitchdata_top_1500_channels;
CREATE VIEW report_twitchdata_top_1500_channels AS
SELECT
`tag` "username",`url`,`logo` "logo_url", `all_time_peak_viewers`, `avg_viewers` "average_viewers", `followers_gained`, `hours_streamed`, `hours_watched`, `rank`, `total_followers`,
CASE
WHEN total_views = -1 THEN 'null'
ELSE total_views
END AS total_views
from twitch_channel;
-- Select data from the view
SELECT * FROM report_twitchdata_top_1500_channels;
```