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
+2 -2
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
}