Skip to content

Commit 9acbe9f

Browse files
authored
Merge pull request #1721 from KanCraft/feature/cicd-twitter
CI/CDがTwitterAPIのせいで失敗しているように見えるのを修正
2 parents 6548d62 + 6293aff commit 9acbe9f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

scripts/egosearch.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ const __main__ = async (intervalHours: number) => {
2626
const q = `艦これウィジェット OR #艦これウィジェット OR #編成キャプチャ -from:KanColleWidget -RT since:${since}`;
2727
console.log("[INFO]", q);
2828
const params = { q };
29-
const { statuses } = await client.get("search/tweets", params);
29+
let statuses = [];
30+
try {
31+
const res = await client.get("search/tweets", params);
32+
statuses = res.statuses;
33+
} catch (err) {
34+
console.log("[ERROR]", err);
35+
// FIXME: process.exit(1); // ひとまずTwitterAPI対応できるまでエラーは無視
36+
return;
37+
}
3038
console.log("[INFO]", "FOUND", statuses.length);
3139
for (let i = 0; i < statuses.length; i++) {
3240
const status = statuses[i];

scripts/tweet.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ if (require.main == module) {
1515
console.log(`Tweet:\thttps://twitter.com/${tweet.user.screen_name}/statuses/${tweet.id_str}\nStatus:\t${status}`);
1616
process.exit(0);
1717
}).catch(err => {
18-
console.error("Error:", err);
19-
process.exit(1);
18+
console.log("[ERROR]", err);
19+
console.log("[DEBUG]", "ツイート内容:\t", status);
20+
// FIXME: process.exit(1); // ひとまずTwitterAPI対応できるまでエラーは無視
2021
});
2122
}

0 commit comments

Comments
 (0)