<commit_before>import fbapi = require("facebook-chat-api");
import https = require("https");
import storage = require("node-persist");
import winston = require("winston");
import { credentials } from "../credentials";
import { Utils } from "../utils";
import { IContext, MessageModule } from "./chat-module";
import { StorageModule } from "./storage";

export class VideosModule extends MessageModule {
    private channelIds: string[] = [
        "UC0jIctUPBK6lHw4AYnGHvCA", // <NAME>
        "UCUgSn3_q1PF6RcPHkuVHFHA", // <NAME>
        "UCWKvCiwesNEBLNioZfrB5mQ", // <NAME>
        "UC9rIUAMjXWvt4Gs-Nwn7cig", // <NAME>
        "UCu9cw1po780fcf0bgPbrqCg", // <NAME>
    ];

    private fileName: string = "videocheck-data.json";

    public getHelpLine(): string {
        return "/videocheck: Sends links for any recent Blimey Cow (and related) videos " +
            "(also runs automatically every 5 minutes)";
    }

    public processMessage(ctx: IContext<fbapi.MessageEvent>): void {
        if (StorageModule.storageInitialized && ctx.message.body === "/videocheck") {
            this.runCheck(ctx.api, ctx.message.threadID, false, ctx.message);
        }
    }

    public autoCheck(api: fbapi.Api): void {
        winston.debug("Auto-checking for new videos");
        this.runCheck(api, "890328284337788", true, undefined); // thread ID is tmbc
    }

    private runCheck(api: fbapi.Api, threadID: string, isAuto: boolean, message: fbapi.MessageEvent): void {
        let messageReason = isAuto ? "automatic timer" : message;
        let messages: string[] = [];
        let channelsDone = 0;
        this.channelIds.forEach(channelId => {
            let path = "/youtube/v3/search?part=snippet&type=video&order=date&" +<commit_msg>remove <NAME> from video check module<commit_after>import fbapi = require("facebook-chat-api");
import https = require("https");
import storage = require("node-persist");
import winston = require("winston");
import { credentials } from "../credentials";
import { Utils } from "../utils";
import { IContext, MessageModule } from "./chat-module";
import { StorageModule } from "./storage";

export class VideosModule extends MessageModule {
    private channelIds: string[] = [
        "UC0jIctUPBK6lHw4AYnGHvCA", // <NAME>
        "UCUgSn3_q1PF6RcPHkuVHFHA", // <NAME>
        "UCWKvCiwesNEBLNioZfrB5mQ", // <NAME>
        "UCu9cw1po780fcf0bgPbrqCg", // <NAME>
    ];

    private fileName: string = "videocheck-data.json";

    public getHelpLine(): string {
        return "/videocheck: Sends links for any recent Blimey Cow (and related) videos " +
            "(also runs automatically every 5 minutes)";
    }

    public processMessage(ctx: IContext<fbapi.MessageEvent>): void {
        if (StorageModule.storageInitialized && ctx.message.body === "/videocheck") {
            this.runCheck(ctx.api, ctx.message.threadID, false, ctx.message);
        }
    }

    public autoCheck(api: fbapi.Api): void {
        winston.debug("Auto-checking for new videos");
        this.runCheck(api, "890328284337788", true, undefined); // thread ID is tmbc
    }

    private runCheck(api: fbapi.Api, threadID: string, isAuto: boolean, message: fbapi.MessageEvent): void {
        let messageReason = isAuto ? "automatic timer" : message;
        let messages: string[] = [];
        let channelsDone = 0;
        this.channelIds.forEach(channelId => {
            let path = "/youtube/v3/search?part=snippet&type=video&order=date&" +
{'fraction_non_alphanumeric': 0.13521288837744533, 'fraction_numerical': 0.018699654775604143, 'mean_word_length': 3.2196601941747574, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5418982', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1081, 'n_words': 255}