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