modify database schema

This commit is contained in:
Jay
2018-06-27 17:50:56 +08:00
parent 1f3057df69
commit 99e5a455cb
6 changed files with 347 additions and 50 deletions
+9 -2
View File
@@ -51,8 +51,9 @@ const getLastPost = async (pageid = '') => {
let time = timeEl.attr('data-utime')
let link = timeEl.parent().attr('href')
let p = t('div.userContent')
let txt = p.first().text()
let txt = p.text() || ''
let id = p.first().attr('id')
if (!id) {
if (/[\?|&]id\=(\d+)/.test(link)) { // eslint-disable-line
let m = link.match(/[\?|&]story_fbid\=(\d+)/) // eslint-disable-line
@@ -64,9 +65,15 @@ const getLastPost = async (pageid = '') => {
if (m !== null && m.length > 1) {
id = m[1]
}
} else if (/\/photos\/.+?\/(\d+)/.test(link)) {
let m = link.match(/\/photos\/.+?\/(\d+)/)
if (m !== null && m.length > 1) {
id = m[1]
}
}
}
if (!time || !link || !txt || !id) return null
console.log(time, link, txt, id)
if (!time || !link || !id) return null
let tmp = {
txt,
id,