update feed

This commit is contained in:
uetchy 2021-02-16 15:11:29 +09:00
parent 325f206d15
commit e9771f6b7e
6 changed files with 42 additions and 21 deletions

View File

@ -129,7 +129,20 @@ ignore:
theme: uio
# Feed
# feed:
# type: atom
# path: feed.xml
# autodiscovery: true
feed:
type: atom
path: feed.xml
autodiscovery: true
limit: 20
order_by: "-date"
tag_dir: "tag"
category_dir: "category"
rss:
enable: false
atom:
enable: true
output: "feed.xml"
jsonFeed:
enable: true
output: "feed.json"

View File

@ -11,10 +11,10 @@
"dependencies": {
"hexo": "^5.0.0",
"hexo-excerpt": "^1.1.6",
"hexo-feed": "^1.1.0",
"hexo-filter-mathjax": "^0.6.3",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",

View File

@ -2,24 +2,24 @@
title: Toxicity Analysis in YouTube Live Chat
---
A little exploration and experiment on toxic activities.
A little analysis and experiment on a flock of toxic people.
# Why
The motivation is quite simple; I just feel sad when they sound suffered from toxic chats. The goal is also simple: design an automated system to spot toxic chat and quarantine them.
The motivation is straightforward; I just feel sad when they sound suffered from toxic chats. The goal is also straightforward: design an automated system to spot toxic chat and quarantine them.
# Data, Data, Data
> I can't make bricks without clay.
> — Sherlock Holmes
I need a myriad of live chat comments and moderation events for analysis and future use.
I need a myriad of live chat comments and moderation events for this.
Unfortunately, YouTube API does not offer a way to retrieve these kinds of events in real time. Which is so crucial because live streams are only place we can observe moderators' activities through API response. Once it gets archived, these events are no longer available.
Unfortunately, YouTube API does not offer a way to retrieve these kinds of events in real time. Which is crucial because live streams are only place we can observe moderators' actions (deletion and BAN). Once it gets archived, these activities are no longer observable.
## Collecting Crusts
So, I ended up developing a library to accumulate events from a YouTube live stream, plus a fancy CLI app mimics live chat. It accepts YouTube video id and save live chats in [JSON Lines](https://jsonlines.org/) format:
So, I ended up developing a library to accumulate events from a YouTube live stream, with a fancy CLI app mimics live chat. It accepts YouTube video id and save live chats in [JSON Lines](https://jsonlines.org/) format:
```bash
collector <videoId>
@ -27,25 +27,25 @@ collector <videoId>
![](realtime-chat.gif)
A line with white text is a normal chat, with red text is a ban event, with yellow text is a deletion event.
## Make a Bread Rise
A line with white text is a normal chat, red text is a ban event, and yellow text is a deletion event.
I know, that's not scalable at all. A new live stream comes in, I copy and paste video id into the terminal and run the script. How sophisticated.
## Make Bread Rise
Thankfully, there's a great web service around Hololive community: [Holotools](https://hololive.jetri.co). They operate an API that gives us an index of past, ongoing, and upcoming live streams from Hololive talents.
Here I divided my system into two components: Scheduler and workers. Scheduler periodically checks for newly scheduled live streams through Holotools API and create a job to be handled by workers. Workers are responsible for handling jobs and spawning a process to collect live chat events.
![](scalability.png)
I run the cluster for a while and by far it hoards approximately 1 million comments per day. Now I could reliably run my own bakery.
I run the cluster for a while and by far it hoards approximately one million comments per day. Now I could reliably run my own bakery.
# Look Before You Leap
Okay take a close look at the data before actually starting to build a model.
Okay now there are five million chats sitting on MongoDB store. Let's take a close look at these before actually starting to build a model.
## Overview
## Troll's Behavior
## By talent

View File

@ -9,7 +9,7 @@ Nextcloud does not have support for generating thumbnails from Affinity Photo an
Glancing at `.afphoto` and `.afdesign` in Finder, I noticed that it has a QuickLook support and an ability to show the thumbnail image. So these files should have thumbnail image somewhere inside its binary.
I wrote a simple script to seek for thumbnail image inside a binary and save it as a PNG file.
I wrote a simple script to seek for [PNG signature](https://www.w3.org/TR/PNG/) inside a binary and save it as a PNG file.
```js
const fs = require("fs");
@ -114,7 +114,7 @@ class Affinity extends ProviderV2 {
![](afphoto.png)
It works!
Easy-peasy!
# Bonus: PDF thumbnail generator

View File

@ -51,5 +51,13 @@
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
/>
<link
rel="stylesheet"
href="https://unpkg.com/highlight.js@9.18.1/styles/night-owl.css"
/>
<%- css('css/index') %>
<!-- Feed -->
<link rel="alternate" type="application/atom+xml" title="<%= config.title %>" href="<%= full_url_for(`/feed.xml`) %>" />
<link rel="alternate" type="application/json" title="<%= config.title %>" href="<%= full_url_for(`/feed.json`) %>" />
</head>

View File

@ -42,14 +42,14 @@
</section>
<!-- Syntax Highlight -->
<link
<!-- <link
rel="stylesheet"
href="https://unpkg.com/highlight.js@9.18.1/styles/night-owl.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
/> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/go.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/scss.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/lua.min.js"></script>
<script>
hljs.initHighlightingOnLoad()
</script>
</script> -->