feat(route): add Web3 Geek Daily (#16475)
* feat(route): add Web3 Geek Daily * Update lib/routes/rebase/geekdaily.ts
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Route } from '@/types';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
export const route: Route = {
|
||||
path: '/geekdaily',
|
||||
categories: ['new-media'],
|
||||
example: '/rebase/geekdaily',
|
||||
radar: [
|
||||
{
|
||||
source: ['rebase.network/geekdaily'],
|
||||
target: '/geekdaily',
|
||||
},
|
||||
],
|
||||
name: 'Web3 Geek Daily',
|
||||
maintainers: ['gaoyifan'],
|
||||
handler: async () => {
|
||||
const response = await ofetch('https://db.rebase.network/api/v1/geekdailies?sort=id:desc');
|
||||
const data = response.data;
|
||||
|
||||
const items = data.map((item) => ({
|
||||
title: item.attributes.title,
|
||||
link: item.attributes.url,
|
||||
description: item.attributes.introduce,
|
||||
pubDate: parseDate(item.attributes.time),
|
||||
author: item.attributes.author,
|
||||
}));
|
||||
|
||||
return {
|
||||
title: 'Web3 Geek Daily',
|
||||
link: 'https://rebase.network/geekdaily',
|
||||
item: items,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: 'Rebase Network',
|
||||
url: 'rebase.network',
|
||||
};
|
||||
Reference in New Issue
Block a user