forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
8 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const { art } = require('@/utils/render'); | ||
const path = require('path'); | ||
|
||
module.exports = async (ctx) => { | ||
const username = ctx.params.name; | ||
|
||
const name_response = await got(`https://curius.app/api/users/${username}`, { | ||
headers: { | ||
Referer: `https://curius.app/${username}`, | ||
}, | ||
}); | ||
|
||
const data = name_response.data; | ||
|
||
const uid = data.user.id; | ||
const name = `${data.user.firstName} ${data.user.lastName}`; | ||
|
||
const response = await got(`https://curius.app/api/users/${uid}/links?page=0`, { | ||
headers: { | ||
Referer: `https://curius.app/${username}`, | ||
}, | ||
}); | ||
|
||
const items = response.data.userSaved.map((item) => ({ | ||
title: item.title, | ||
description: art(path.join(__dirname, 'templates/description.art'), { | ||
item, | ||
}), | ||
link: item.link, | ||
pubDate: parseDate(item.createdDate), | ||
guid: `curius:${username}:${item.id}`, | ||
})); | ||
|
||
ctx.state.data = { | ||
title: `${name} - Curius`, | ||
link: `https://curius.app/${username}`, | ||
description: `${name} - Curius`, | ||
allowEmpty: true, | ||
item: items, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'/links/:name': ['Ovler-Young'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
'curius.app': { | ||
_name: 'Curius', | ||
'.': [ | ||
{ | ||
title: '用户', | ||
docs: 'https://docs.rsshub.app/social-media.html#curius', | ||
source: '/:name', | ||
target: '/curius/links/:name', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function (router) { | ||
router.get('/links/:name', require('./links')); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{ if item.metadata.full_text }} | ||
原文:{{@ item.metadata.full_text.replace(/\n/gm, '<br>') }}<br><br> | ||
{{ /if }} | ||
{{ if item.comments.length }} | ||
评论:{{ item.comments[0].text.substring(0, 100) }}<br><br> | ||
{{ /if }} | ||
{{ if item.highlights.length }} | ||
评论: | ||
{{ each item.highlights highlight }} | ||
{{ if highlight.comment }} | ||
{{ highlight.highlight }}<br>评论:{{ highlight.comment.text }}<br> | ||
{{ else }} | ||
<br>标注:{{ highlight.highlight }}<br> | ||
{{ /if }} | ||
{{ /each }} | ||
{{ /if }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
649641f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rsshub-master – ./
rsshub-master-auto-bot-ty.vercel.app
rsshub-master-git-master-auto-bot-ty.vercel.app
rsshub-master.vercel.app