mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
@@ -804,20 +804,6 @@ Supported sub-sites:
|
||||
|
||||
<Route author="alizeegod" example="/nba/app_news" path="/nba/app_news"/>
|
||||
|
||||
## 腾讯大家
|
||||
|
||||
### 首页
|
||||
|
||||
<Route author="xyqfer" example="/dajia" path="/dajia"/>
|
||||
|
||||
### 作者作品
|
||||
|
||||
<Route author="LogicJake" example="/dajia/author/404" path="/dajia/author/:uid" :paramsDesc="['作者id']"/>
|
||||
|
||||
### 专栏
|
||||
|
||||
<Route author="LogicJake" example="/dajia/zhuanlan/404" path="/dajia/zhuanlan/:uid" :paramsDesc="['专栏id']"/>
|
||||
|
||||
## 腾讯谷雨
|
||||
|
||||
### 栏目
|
||||
|
||||
@@ -442,11 +442,6 @@ router.get('/oschina/topic/:topic', require('./routes/oschina/topic'));
|
||||
router.get('/aqk/vul', require('./routes/aqk/vul'));
|
||||
router.get('/aqk/:category', require('./routes/aqk/category'));
|
||||
|
||||
// 腾讯大家
|
||||
router.get('/dajia', require('./routes/tencent/dajia/index'));
|
||||
router.get('/dajia/author/:uid', require('./routes/tencent/dajia/author'));
|
||||
router.get('/dajia/zhuanlan/:uid', require('./routes/tencent/dajia/zhuanlan'));
|
||||
|
||||
// 腾讯游戏开发者社区
|
||||
router.get('/gameinstitute/community/:tag?', require('./routes/tencent/gameinstitute/community'));
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const uid = ctx.params.uid;
|
||||
const link = `http://dajia.qq.com/author_personal.htm#!/${uid}`;
|
||||
|
||||
const info_api = `http://i.match.qq.com/ninjayc/dajiazuozheye?action=zuojia&authorid=${uid}`;
|
||||
const info_response = await got.get(info_api);
|
||||
const author_name = info_response.data.data.author.name;
|
||||
const description = info_response.data.data.author.description;
|
||||
|
||||
const article_api = `http://i.match.qq.com/ninjayc/dajiawenzhanglist?action=wz&authorid=${uid}`;
|
||||
const response = await got.get(article_api);
|
||||
const list = response.data.data;
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map(async (info) => {
|
||||
const title = info.n_title;
|
||||
const date = info.n_publishtime;
|
||||
const itemUrl = info.n_mobile_url;
|
||||
|
||||
const cache = await ctx.cache.get(itemUrl);
|
||||
if (cache) {
|
||||
return Promise.resolve(JSON.parse(cache));
|
||||
}
|
||||
|
||||
const response = await got.get(itemUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
const description = $('#articleContent')
|
||||
.html()
|
||||
.replace(/src="\//g, 'src="http:/')
|
||||
.trim();
|
||||
|
||||
const single = {
|
||||
title: title,
|
||||
link: itemUrl,
|
||||
description: description,
|
||||
pubDate: new Date(date).toUTCString(),
|
||||
};
|
||||
ctx.cache.set(itemUrl, JSON.stringify(single));
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${author_name}的文章——腾讯大家`,
|
||||
link: link,
|
||||
description: description,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
@@ -1,66 +0,0 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const iconv = require('iconv-lite');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const listRes = await got({
|
||||
method: 'get',
|
||||
url: 'http://i.match.qq.com/ninjayc/dajia?action=getwenz&p=0&num=20&callback=',
|
||||
headers: {
|
||||
Referer: 'http://dajia.qq.com/m/index.html',
|
||||
},
|
||||
});
|
||||
|
||||
const storyList = JSON.parse(listRes.data.slice(1, -2)).data;
|
||||
const resultItem = await Promise.all(
|
||||
storyList.map(async (story) => {
|
||||
const mobileUrl = story.n_mobile_url;
|
||||
const pcUrl = story.n_url;
|
||||
const item = {
|
||||
title: story.n_title,
|
||||
description: '',
|
||||
link: pcUrl,
|
||||
guid: mobileUrl,
|
||||
author: story.name,
|
||||
pubDate: new Date(story.n_publishtime).toUTCString(),
|
||||
};
|
||||
const key = `tx-dajia: ${mobileUrl}`;
|
||||
const value = await ctx.cache.get(key);
|
||||
|
||||
if (value) {
|
||||
item.description = value;
|
||||
} else {
|
||||
const storyDetail = await got({
|
||||
method: 'get',
|
||||
url: pcUrl,
|
||||
headers: {
|
||||
Referer: pcUrl,
|
||||
},
|
||||
responseType: 'buffer',
|
||||
});
|
||||
const $ = cheerio.load(iconv.decode(storyDetail.data, 'gb2312'));
|
||||
$('#articleContent img').each(function(_, item) {
|
||||
const $img = $(item);
|
||||
const src = $img.attr('src');
|
||||
|
||||
if (!(src.startsWith('https://') || src.startsWith('http://'))) {
|
||||
$img.attr('src', `https:${src}`);
|
||||
}
|
||||
|
||||
$img.attr('referrerpolicy', 'no-referrer');
|
||||
});
|
||||
|
||||
item.description = $('#articleContent').html();
|
||||
ctx.cache.set(key, item.description);
|
||||
}
|
||||
|
||||
return Promise.resolve(item);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '腾讯大家',
|
||||
link: 'http://dajia.qq.com/',
|
||||
item: resultItem,
|
||||
};
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const uid = ctx.params.uid;
|
||||
const link = `http://dajia.qq.com/tanzi_diceng.htm#!/${uid}`;
|
||||
|
||||
const info_api = `http://i.match.qq.com/ninjayc/dajialanmu?action=lanmu&channelid=${uid}`;
|
||||
const info_response = await got.get(info_api);
|
||||
const name = info_response.data.data.channel.n_cname;
|
||||
const description = info_response.data.data.channel.n_describe;
|
||||
|
||||
const article_api = `http://i.match.qq.com/ninjayc/dajiawenzhanglist?action=wz&channelid=${uid}`;
|
||||
const response = await got.get(article_api);
|
||||
const list = response.data.data;
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map(async (info) => {
|
||||
const title = info.n_title;
|
||||
const date = info.n_publishtime;
|
||||
const itemUrl = info.n_mobile_url;
|
||||
const author = info.name;
|
||||
|
||||
const cache = await ctx.cache.get(itemUrl);
|
||||
if (cache) {
|
||||
return Promise.resolve(JSON.parse(cache));
|
||||
}
|
||||
|
||||
const response = await got.get(itemUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
const description = $('#articleContent')
|
||||
.html()
|
||||
.replace(/src="\//g, 'src="http:/')
|
||||
.trim();
|
||||
|
||||
const single = {
|
||||
title: title,
|
||||
link: itemUrl,
|
||||
description: description,
|
||||
author: author,
|
||||
pubDate: new Date(date).toUTCString(),
|
||||
};
|
||||
ctx.cache.set(itemUrl, JSON.stringify(single));
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${name}——腾讯大家`,
|
||||
link: link,
|
||||
description: description,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user