Compare commits
2 Commits
f840d754ac
...
a86e4b2876
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a86e4b2876 | ||
|
|
a7bcf971c4 |
@@ -14,8 +14,8 @@ exports.RSSController = class RSSController {
|
||||
}
|
||||
|
||||
async start(){
|
||||
// Wait 30 seconds for the rest of the bot to start before starting rss feeds
|
||||
await new Promise(resolve => setTimeout(resolve, 30000));
|
||||
// Wait for the refresh period before starting rss feeds, so the rest of the bot can start
|
||||
await new Promise(resolve => setTimeout(resolve, refreshInterval));
|
||||
|
||||
log.INFO("Starting RSS Controller");
|
||||
// Get initial feeds before the starting the infinite loop
|
||||
|
||||
@@ -88,7 +88,7 @@ exports.sendPost = (post, source, channel, callback) => {
|
||||
// Check for embedded youtube videos and add the first four as links
|
||||
const ytVideos = String(post.content).match(youtubeVideoRegex);
|
||||
if (ytVideos) {
|
||||
for (const ytVideo of ytVideos.slice(0,4)){
|
||||
for (var ytVideo of ytVideos.slice(0,4)){
|
||||
// If the video is an embed, replace the embed to make it watchable
|
||||
if (ytVideo.includes("embed")) ytVideo = ytVideo.replace("embed/", "watch?v=");
|
||||
postContent += `\nEmbeded Video from Post: [YouTube](${ytVideo})`
|
||||
@@ -147,4 +147,4 @@ exports.sendPost = (post, source, channel, callback) => {
|
||||
|
||||
exports.returnHash = (...stringsIncluded) => {
|
||||
return crypto.createHash('sha1').update(`${stringsIncluded.join("-<<??//\\\\??>>-")}`).digest("base64");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user