1
0
Fork 0
Play with data for weather waifus.
Go to file
pta cb105176b2 Add cron job to make final view count update after exactly 10 days
This cron job will run twice per live WNL segment to update the view
count of the stream from exactly 10 days ago. This gives every stream
exactly the same amount of time to mature before we record its view
count for the last time. Ten days gives even notable streams plenty of
time to get most of its views before the rewatch per day rate drops to
nearly nothing.
2024-05-09 12:46:16 -04:00
bin Add cron job to make final view count update after exactly 10 days 2024-05-09 12:46:16 -04:00
sql Insert au PAY shows for 2024-05 2024-04-28 10:51:55 -07:00
src Add cron job to make final view count update after exactly 10 days 2024-05-09 12:46:16 -04:00
www Align views column to the right 2024-04-23 07:55:36 -07:00
.gitignore Send file logs to log/ directory 2023-09-23 22:36:29 -07:00
BACKSTORY.org Add a link to the spreadsheet from @smile_hakumai 2023-09-26 05:44:17 -07:00
LICENSE Initial commit 2023-07-18 05:34:50 +00:00
Project.toml Add PlotlyJS as a dependency 2024-04-29 02:39:22 -07:00
README.md Add cron job to make final view count update after exactly 10 days 2024-05-09 12:46:16 -04:00
crontab Add cron job to make final view count update after exactly 10 days 2024-05-09 12:46:16 -04:00
crontab-vern Put archive directory in variable WNAR 2023-09-13 15:42:31 -07:00

README.md

WeatherNews.jl

Play with data for weather waifus.

Learning Julia

I've admired Julia from afar for too long. I want to learn how to use this language, so I started this little project to feel the language out and do something fun.

First Time

To download and compile all the depenencies, use the REPL's package mode.

  • ] (enter package mode)
  • activate .
  • instantiate
  • Hit backspace to go back to the normal Julia mode in the REPL.
julia> ]
(@v1.9) pkg> activate .
  Activating project at `~/WeatherNews.jl`

(WeatherNews) pkg> instantiate

That instantiate may take some time especially on a slower computer. After this is done, you can try playing with the code.

using WeatherNews
using WeatherNews: API, DB
v = API.video_ids()
s = WeatherNews.get_schedule()

using DataFrames
s |> DataFrame

Install yt-dlp. Optionally install jq for pretty-printing and exploring json on the command line.

Scripts

bin/weathernews.jl

This was the first script that gave birth to this project.

Running from the CLI

julia --project -O0 --compile=min bin/weathernews.jl

Running from the REPL

# ] activate .
include("bin/weathernews.jl")
main()

Data Collection System

There are a variety of scripts written in Julia, Bash, and Perl for collecting WeatherNews data. An example of how they should be run can be found in the crontab example.

  • bin/wndb-insert.jl :: This script is meant to be run from cron multiple times per day to insert new rows into the schedule table.
  • bin/wndb-video.jl :: This script is meant to be run every three hours to add video IDs and view counts to the newest WNL rows in the schedule table.
  • bin/wndb-fix-conflict.jl :: This script is meant to be run throughout the day to detect and fix schedule changes. If the API response for the schedule conflicts with what's in the database, the API response wins and what was in the database gets moved to the cancellation table.
  • bin/schedule-archive.sh :: This script is for archiving raw JSON responses from the WeatherNews API. I'm archiving the JSON mostly for redundancy. If wndb-insert.jl were to fail, I'd hopefully have JSON data I can use to fix the database after the problem has been fixed.
  • bin/video-archive.sh :: Archive video JSON responses.
  • bin/mscale-archive.sh :: Archive mscale JSON responses.
  • bin/mscale-record.sh :: This script is meant to be run hourly to record the M-scale value from the WeatherNews API.
  • bin/aupay-insert.pl :: This script scrapes an invidious page for au PAY Market livestreams and inserts new au PAY shows it hasn't seen before. It can be run infrequently like once a week.
  • bin/wndb-viewcount-update.jl :: This script is meant to be run twice during every WNL stream to make a last view count update to the stream 240 hours prior.

Web Site

Under www/ is the source for a web site written in Perl for displaying the WeatherNews data that has been collected by the various scripts.