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.
feat(route): add route for easynomad (DIYgod#16677)
* easynomad * feat(route): add route for easynomad * feat(route): add route for easynomad
- Loading branch information
1 parent
12d2f22
commit 74f6fd6
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Route, ViewType } from '@/types'; | ||
import got from '@/utils/got'; | ||
import MarkdownIt from 'markdown-it'; | ||
const md = MarkdownIt({ | ||
html: true, | ||
linkify: true, | ||
}); | ||
import { parseDate } from '@/utils/parse-date'; | ||
|
||
export const route: Route = { | ||
path: '/', | ||
categories: ['other'], | ||
view: ViewType.Notifications, | ||
example: '/easynomad', | ||
radar: [ | ||
{ | ||
source: ['easynomad.cn'], | ||
}, | ||
], | ||
name: '远程工作列表', | ||
maintainers: ['jiangsong216'], | ||
handler, | ||
|
||
features: { | ||
requireConfig: false, | ||
requirePuppeteer: false, | ||
antiCrawler: false, | ||
supportBT: false, | ||
supportPodcast: false, | ||
supportScihub: false, | ||
}, | ||
}; | ||
|
||
async function handler() { | ||
const host = 'https://easynomad.cn'; | ||
const url = 'https://easynomad.cn/api/posts/list?limit=15&page=1&jobCategory=&contractType='; | ||
const response = await got({ | ||
method: 'get', | ||
url, | ||
}); | ||
const data = response.data.data; | ||
|
||
const items = data.map((item) => ({ | ||
title: item.jobTitle, | ||
description: item.descContent ? md.render(item.descContent) : 'No description', | ||
pubDate: parseDate(item.jobPublishTime), | ||
link: item.url, | ||
})); | ||
|
||
return { | ||
title: '轻松游牧-远程工作聚合列表', | ||
description: '支持国内远程的招聘列表,远程全职,远程兼职', | ||
link: host, | ||
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,6 @@ | ||
import type { Namespace } from '@/types'; | ||
|
||
export const namespace: Namespace = { | ||
name: '轻松游牧-远程工作聚集地', | ||
url: 'easynomad.cn', | ||
}; |