Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Support openrec" #41

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

"content_scripts": [
{
"matches": ["https://www.youtube.com/*", "https://www.mildom.com/*", "https://www.twitch.tv/*", "https://www.openrec.tv/*"],
"matches": ["https://www.youtube.com/*", "https://www.mildom.com/*", "https://www.twitch.tv/*"],
"js": ["js/content_script.js"]
}
],
Expand Down
3 changes: 1 addition & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ const DEFAULT_REPEAT_THROW_THRESHOLD = 2;
const DEFAULT_REPEAT_WORD_THRESHOLD = 2;
const DEFAULT_POST_FLOOD_THRESHOLD = 5;
const DEFAULT_LENGTH_THRESHOLD = 200;
const DEFAULT_LOOK_CHATS = 50;
const DEFAULT_NG_WORDS: string[] = [];
const DEFAULT_IS_SHOW_REASON = false;
const DEFAULT_IS_ACTIVATE = true;

export const DEFAULT_LOOK_CHATS = 50;
export const DEFAULT_EXECUTION_INTERVAL_MS = 3000;
export const OBSERVATION_INTERVAL_MS = 5000;

export const YOUTUBE_REGEX = /https:\/\/www\.youtube\.com.*/;
export const MILDOM_REGEX = /https:\/\/www\.mildom\.com.*/;
export const TWITCH_REGEX = /https:\/\/www\.twitch\.tv.*/;
export const OPENREC_REGEX = /https:\/\/www\.openrec\.tv.*/;

export const defaultParams: IParameter = {
[KEY_REPEAT_THROW]: DEFAULT_REPEAT_THROW_THRESHOLD,
Expand Down
3 changes: 1 addition & 2 deletions src/content_script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from "./moderate";
import {
DEFAULT_EXECUTION_INTERVAL_MS,
DEFAULT_LOOK_CHATS,
getParams,
OBSERVATION_INTERVAL_MS,
} from "./config";
Expand All @@ -17,7 +16,7 @@ import { selectSource } from "./source/source";
let worker: Worker | null;
let api: IKuromojiWorker | null;

let lookChats = DEFAULT_LOOK_CHATS;
let lookChats = 0;

let timerId: number;

Expand Down
58 changes: 0 additions & 58 deletions src/source/openrec.ts

This file was deleted.

10 changes: 1 addition & 9 deletions src/source/source.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { IChat } from "../chat";
import {
MILDOM_REGEX,
OPENREC_REGEX,
TWITCH_REGEX,
YOUTUBE_REGEX,
} from "../config";
import { MILDOM_REGEX, TWITCH_REGEX, YOUTUBE_REGEX } from "../config";
import { Youtube } from "./youtube";
import { Mildom } from "./mildom";
import { Twitch } from "./twitch";
import { Openrec } from "./openrec";

export interface ISource {
extractChats: (lookNum: number) => IChat[];
Expand All @@ -21,8 +15,6 @@ export const selectSource = (url: string): ISource | null => {
return Mildom;
} else if (TWITCH_REGEX.test(url)) {
return Twitch;
} else if (OPENREC_REGEX.test(url)) {
return Openrec;
}
return null;
};