modify facebook link

This commit is contained in:
Jay 2018-08-28 22:04:50 +08:00
parent 098bcff5a4
commit ac446758b6
2 changed files with 3 additions and 8 deletions

View File

@ -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) {

View File

@ -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
}