Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
code diff twitch follows
作成日
4 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
3 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
53 行
すべてコピー
1 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
53 行
すべてコピー
import common from "../common-polling.mjs";
import common from "../common-polling.mjs";
export default {
export default {
...common,
...common,
name: "New Follower (Instant)",
name: "New Follower (Instant)",
key: "twitch-new-follower",
key: "twitch-new-follower",
description: "Emit new event when a new user follows your channel.",
description: "Emit new event when a new user follows your channel.",
type: "source",
type: "source",
version: "0.0.4",
version: "0.0.4",
methods: {
methods: {
...common.methods,
...common.methods,
async getTopics() {
async getTopics() {
// get the authenticated user
// get the authenticated user
const { data } = await this.twitch.getUsers();
const { data } = await this.twitch.getUsers();
return [
return [
`users/follows?first=1&to_id=${data[0].id}`,
`users/follows?first=1&to_id=${data[0].id}`,
];
];
},
},
getMeta(item) {
getMeta(item) {
const {
const {
コピー
コピー済み
コピー
コピー済み
from_id,
to_id, followed_at, from_name,
to_id, followed_at, from_name,
} = item;
} = item;
return {
return {
コピー
コピー済み
コピー
コピー済み
id:
from_id +
to_id + followed_at,
id:
to_id + followed_at,
summary: `${from_name} is a new follower`,
summary: `${from_name} is a new follower`,
ts: new Date(followed_at).getTime(),
ts: new Date(followed_at).getTime(),
};
};
},
},
},
},
hooks: {
hooks: {
async deploy() {
async deploy() {
// get the authenticated user
// get the authenticated user
const { data: authenticatedUserData } = await this.twitch.getUsers();
const { data: authenticatedUserData } = await this.twitch.getUsers();
this.db.set("authenticatedUserId", authenticatedUserData[0].id);
this.db.set("authenticatedUserId", authenticatedUserData[0].id);
},
},
},
},
async run() {
async run() {
const params = {
const params = {
コピー
コピー済み
コピー
コピー済み
from
_id: this.db.get("authenticatedUserId"),
to
_id: this.db.get("authenticatedUserId"),
};
};
// get the user_ids of the streamers followed by the authenticated user
// get the user_ids of the streamers followed by the authenticated user
const follows = this.paginate(
const follows = this.paginate(
this.twitch.getUserFollows.bind(this),
this.twitch.getUserFollows.bind(this),
params,
params,
);
);
for await (const follow of follows) {
for await (const follow of follows) {
this.$emit(follow, this.getMeta(follow));
this.$emit(follow, this.getMeta(follow));
}
}
},
},
};
};
保存された差分
原文
ファイルを開く
import common from "../common-polling.mjs"; export default { ...common, name: "New Follower (Instant)", key: "twitch-new-follower", description: "Emit new event when a new user follows your channel.", type: "source", version: "0.0.4", methods: { ...common.methods, async getTopics() { // get the authenticated user const { data } = await this.twitch.getUsers(); return [ `users/follows?first=1&to_id=${data[0].id}`, ]; }, getMeta(item) { const { from_id, to_id, followed_at, from_name, } = item; return { id: from_id + to_id + followed_at, summary: `${from_name} is a new follower`, ts: new Date(followed_at).getTime(), }; }, }, hooks: { async deploy() { // get the authenticated user const { data: authenticatedUserData } = await this.twitch.getUsers(); this.db.set("authenticatedUserId", authenticatedUserData[0].id); }, }, async run() { const params = { from_id: this.db.get("authenticatedUserId"), }; // get the user_ids of the streamers followed by the authenticated user const follows = this.paginate( this.twitch.getUserFollows.bind(this), params, ); for await (const follow of follows) { this.$emit(follow, this.getMeta(follow)); } }, };
変更されたテキスト
ファイルを開く
import common from "../common-polling.mjs"; export default { ...common, name: "New Follower (Instant)", key: "twitch-new-follower", description: "Emit new event when a new user follows your channel.", type: "source", version: "0.0.4", methods: { ...common.methods, async getTopics() { // get the authenticated user const { data } = await this.twitch.getUsers(); return [ `users/follows?first=1&to_id=${data[0].id}`, ]; }, getMeta(item) { const { to_id, followed_at, from_name, } = item; return { id: to_id + followed_at, summary: `${from_name} is a new follower`, ts: new Date(followed_at).getTime(), }; }, }, hooks: { async deploy() { // get the authenticated user const { data: authenticatedUserData } = await this.twitch.getUsers(); this.db.set("authenticatedUserId", authenticatedUserData[0].id); }, }, async run() { const params = { to_id: this.db.get("authenticatedUserId"), }; // get the user_ids of the streamers followed by the authenticated user const follows = this.paginate( this.twitch.getUserFollows.bind(this), params, ); for await (const follow of follows) { this.$emit(follow, this.getMeta(follow)); } }, };
違いを見つける