This commit is contained in:
parent
ad28c3515c
commit
4aaf24f3b3
5
index.js
5
index.js
|
@ -1,5 +1,6 @@
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const scraper = require('tiktok-scraper')
|
const scraper = require('tiktok-scraper')
|
||||||
|
const he = require('he')
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
const port = 8080
|
const port = 8080
|
||||||
|
@ -18,8 +19,8 @@ app.get('/user/:user', async (req, res) => {
|
||||||
for (const post of posts.collector) {
|
for (const post of posts.collector) {
|
||||||
feed.items.push({
|
feed.items.push({
|
||||||
"id": post.id,
|
"id": post.id,
|
||||||
"title": post.text,
|
"title": `Post by @${user}`,
|
||||||
"content_text": post.text,
|
"content_html": he.encode(post.text),
|
||||||
"url": post.webVideoUrl,
|
"url": post.webVideoUrl,
|
||||||
"date_published": new Date(parseInt(post.createTime, 10) * 1000),
|
"date_published": new Date(parseInt(post.createTime, 10) * 1000),
|
||||||
"attachments": [
|
"attachments": [
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"tiktok-scraper": "^1.1.10"
|
"he": "^1.2.0",
|
||||||
|
"tiktok-scraper": "^1.1.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user