Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
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)); } }, };
비교하기