From ac446758b67943364da43bf5ffa2ea759c524ab3 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 28 Aug 2018 22:04:50 +0800 Subject: [PATCH] modify facebook link --- background.js | 7 +------ libs/facebook-pageparse/index.js | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/background.js b/background.js index efc411e..cb6224e 100644 --- a/background.js +++ b/background.js @@ -3,7 +3,6 @@ const cron = require('cron') const DB = require('./libs/database') const fbParser = require('./libs/facebook-pageparse') const api = require('./libs/api-action') -const event = require('./event') const axios = require('axios') new cron.CronJob({ // eslint-disable-line @@ -310,14 +309,10 @@ const checkDonate = async (loginName = null, opayid = null) => { values }) let msg = `/me 感謝 ${i.name} 贊助了 ${i.amount} 元, ${i.msg}` - //event.emit('twitchSend', { - // msg, - // channel: loginName - //}) process.send({ type: 'twitchSend', data: { - msg, channel: loginName + msg, channel: loginName } }) } catch (err) { diff --git a/libs/facebook-pageparse/index.js b/libs/facebook-pageparse/index.js index 006f1cf..9fe77cb 100644 --- a/libs/facebook-pageparse/index.js +++ b/libs/facebook-pageparse/index.js @@ -19,7 +19,7 @@ const getLastPost = async (pageid = '') => { console.log('access facebook fan page :::: ' + pageid) let page = await new Promise((resolve) => { request({ - baseUrl: 'https://facebook.com', + baseUrl: 'https://www.facebook.com', url: `/${encodeURIComponent(pageid)}/posts`, method: 'get', headers: { @@ -95,7 +95,7 @@ const getLastPost = async (pageid = '') => { return b.time - a.time }) let post = posts[0] - post.link = `https://facebook.com/${post.link.replace(/^\//, '')}` + post.link = `https://www.facebook.com/${post.link.replace(/^\//, '')}` return post }