|
@@ -37,12 +37,11 @@ const processTweetBody = (tweet) => {
|
|
|
.replace(/((?<=\s)#.*?\s+)+$/g, '')
|
|
|
.trim()
|
|
|
.match(/(.*?)\n\n(.*)/s).slice(1);
|
|
|
- const date = new Date(tweet.created_at);
|
|
|
- const formatedDate = [[date.getFullYear(), 4], [date.getMonth(), 2], [date.getDate(), 2]]
|
|
|
- .map(([value, padLength]) => value.toString().padStart(padLength, '0'))
|
|
|
- .join('');
|
|
|
- const pageTitle = title.replace(/[【】\/]/g, '') + `${exports.recurringKeywords.some(keyword => new RegExp(keyword).exec(title)) ? `-${formatedDate}` : ''}`;
|
|
|
- return { title, body, pageTitle, date: formatedDate };
|
|
|
+ const date = new Date(tweet.created_at)
|
|
|
+ .toLocaleDateString('en-CA', { timeZone: 'Asia/Tokyo' })
|
|
|
+ .replace(/-/g, '');
|
|
|
+ const pageTitle = title.replace(/[【】\/]/g, '') + `${exports.recurringKeywords.some(keyword => new RegExp(keyword).exec(title)) ? `-${date}` : ''}`;
|
|
|
+ return { title, body, pageTitle, date };
|
|
|
};
|
|
|
exports.processTweetBody = processTweetBody;
|
|
|
const parseAction = (action) => {
|
|
@@ -81,7 +80,8 @@ class default_1 {
|
|
|
if (match) {
|
|
|
config = {
|
|
|
screen_name: match[1],
|
|
|
- exclude_replies: false,
|
|
|
+ exclude_replies: true,
|
|
|
+ include_rts: false,
|
|
|
tweet_mode: 'extended',
|
|
|
};
|
|
|
endpoint = 'statuses/user_timeline';
|
|
@@ -145,11 +145,10 @@ class default_1 {
|
|
|
const message = `已更新如下页面:${(0, exports.parseAction)(action)}`;
|
|
|
return Promise.all(this.lock.subscribers.map(subscriber => this.bot.sendTo(subscriber, message)));
|
|
|
}
|
|
|
- })
|
|
|
- .then(updateDate).then(updateOffset);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
- }));
|
|
|
+ })).then(updateDate).then(updateOffset);
|
|
|
})
|
|
|
.then(() => {
|
|
|
let timeout = this.workInterval * 1000;
|