From e9771f6b7e6cedb2c86944950678fca3f5503628 Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Tue, 16 Feb 2021 15:11:29 +0900 Subject: [PATCH] update feed --- _config.yml | 19 ++++++++++++++++--- package.json | 2 +- source/_drafts/youtube-live-analysis.md | 22 +++++++++++----------- source/_posts/2021/affinity-thumbnail.md | 4 ++-- themes/uio/layout/_partial/head.ejs | 8 ++++++++ themes/uio/layout/post.ejs | 8 ++++---- 6 files changed, 42 insertions(+), 21 deletions(-) diff --git a/_config.yml b/_config.yml index 7a56505..e5278de 100644 --- a/_config.yml +++ b/_config.yml @@ -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" diff --git a/package.json b/package.json index f475c19..594848c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/source/_drafts/youtube-live-analysis.md b/source/_drafts/youtube-live-analysis.md index e614a93..0924d46 100644 --- a/source/_drafts/youtube-live-analysis.md +++ b/source/_drafts/youtube-live-analysis.md @@ -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 @@ -27,25 +27,25 @@ collector ![](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 diff --git a/source/_posts/2021/affinity-thumbnail.md b/source/_posts/2021/affinity-thumbnail.md index b29ceb1..abbf005 100644 --- a/source/_posts/2021/affinity-thumbnail.md +++ b/source/_posts/2021/affinity-thumbnail.md @@ -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 diff --git a/themes/uio/layout/_partial/head.ejs b/themes/uio/layout/_partial/head.ejs index f014a0f..c51e797 100755 --- a/themes/uio/layout/_partial/head.ejs +++ b/themes/uio/layout/_partial/head.ejs @@ -51,5 +51,13 @@ rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" /> + <%- css('css/index') %> + + + + \ No newline at end of file diff --git a/themes/uio/layout/post.ejs b/themes/uio/layout/post.ejs index b47816d..1f27db1 100755 --- a/themes/uio/layout/post.ejs +++ b/themes/uio/layout/post.ejs @@ -42,14 +42,14 @@ - - +/> --> + \ No newline at end of file