diff --git a/index.js b/index.js index 14c58b2..1d43e35 100644 --- a/index.js +++ b/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": [ diff --git a/package.json b/package.json index 6ca7383..a1deb15 100644 --- a/package.json +++ b/package.json @@ -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" } }