Skip to content

Commit

Permalink
fix(route): 腾讯较真查证平台 (#7934)
Browse files Browse the repository at this point in the history
  • Loading branch information
weirongxu authored Aug 12, 2021
1 parent 17e02cc commit ce15d05
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/routes/tencent/factcheck/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const cheerio = require('cheerio');
const CryptoJS = require('crypto-js');

const getRequestToken = () => {
const t = 'jzhotdata',
e = 'sgn51n6r6q97o6g3',
n = CryptoJS.DES.encrypt(Date.now().toString() + '-' + e, t).toString();
return encodeURIComponent(n);
};

module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://vp.fact.qq.com/loadmore?artnum=0&page=0',
url: `https://vp.fact.qq.com/loadmore?artnum=0&page=0&token=${getRequestToken()}`,
headers: {
Referer: 'https://vp.fact.qq.com/home',
},
Expand All @@ -18,8 +27,8 @@ module.exports = async (ctx) => {
const simple = {
title: `【${item.explain}${item.title}`,
description: `<img src="${item.cover}">${item.abstract}`,
pubDate: new Date(item.date).toUTCString(),
author: `${item.author}${item.author !== item.authordesc ? '-' + item.authordesc : ''}`,
pubDate: parseDate(item.date, 'YYYY-MM-DD'),
author: item.author,
link: link,
};

Expand Down

1 comment on commit ce15d05

@vercel
Copy link

@vercel vercel bot commented on ce15d05 Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.