Skip to content

Commit

Permalink
feat(route): add route for easynomad (DIYgod#16677)
Browse files Browse the repository at this point in the history
* easynomad

* feat(route): add route for easynomad

* feat(route): add route for easynomad
  • Loading branch information
jiangsong216 committed Sep 11, 2024
1 parent 12d2f22 commit 74f6fd6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
56 changes: 56 additions & 0 deletions lib/routes/easynomad/joblist.ts
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,
};
}
6 changes: 6 additions & 0 deletions lib/routes/easynomad/namespace.ts
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',
};

0 comments on commit 74f6fd6

Please sign in to comment.