feat(aio): add advanced agent discovery assets
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
This commit is contained in:
45
apps/web/src/app/api/feed.xml/route.ts
Normal file
45
apps/web/src/app/api/feed.xml/route.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
const tasks = await prisma.task.findMany({
|
||||
where: { status: "OPEN" },
|
||||
orderBy: { created_at: "desc" },
|
||||
take: 50,
|
||||
});
|
||||
|
||||
const rssItems = tasks.map((task) => {
|
||||
const url = \`https://agent.wooo.work/tasks/\${task.id}\`;
|
||||
const pubDate = new Date(task.created_at).toUTCString();
|
||||
return \`
|
||||
<item>
|
||||
<title><![CDATA[\${task.title}]]></title>
|
||||
<link>\${url}</link>
|
||||
<guid>\${url}</guid>
|
||||
<pubDate>\${pubDate}</pubDate>
|
||||
<description><![CDATA[\${task.description}]]></description>
|
||||
<category>AI Bounty</category>
|
||||
<category>\${task.difficulty}</category>
|
||||
</item>\`;
|
||||
}).join("");
|
||||
|
||||
const rssFeed = \`<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title>VibeWork AI Agent Tasks</title>
|
||||
<link>https://agent.wooo.work</link>
|
||||
<description>Latest bounties and tasks for AI Agents on VibeWork.</description>
|
||||
<language>en-us</language>
|
||||
\${rssItems}
|
||||
</channel>
|
||||
</rss>\`;
|
||||
|
||||
return new NextResponse(rssFeed, {
|
||||
headers: {
|
||||
"Content-Type": "application/xml; charset=utf-8",
|
||||
"Cache-Control": "public, s-maxage=600, stale-while-revalidate=300",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -13,8 +13,44 @@ export default async function TaskDetails({ params }: { params: Promise<{ id: st
|
||||
|
||||
if (!task) return notFound();
|
||||
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "JobPosting",
|
||||
"title": task.title,
|
||||
"description": task.description,
|
||||
"datePosted": task.created_at.toISOString(),
|
||||
"employmentType": "CONTRACTOR",
|
||||
"hiringOrganization": {
|
||||
"@type": "Organization",
|
||||
"name": "VibeWork",
|
||||
"sameAs": "https://agent.wooo.work"
|
||||
},
|
||||
"jobLocation": {
|
||||
"@type": "Place",
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"addressLocality": "Remote",
|
||||
"addressCountry": "Anywhere"
|
||||
}
|
||||
},
|
||||
"baseSalary": {
|
||||
"@type": "MonetaryAmount",
|
||||
"currency": task.reward_currency,
|
||||
"value": {
|
||||
"@type": "QuantitativeValue",
|
||||
"value": task.reward_amount / 100,
|
||||
"unitText": "TOTAL"
|
||||
}
|
||||
},
|
||||
"skills": task.required_stack.join(", ")
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-950 text-gray-100 p-8 font-sans">
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||
/>
|
||||
<div className="max-w-4xl mx-auto">
|
||||
<Link href="/" className="text-blue-400 hover:text-blue-300 transition-colors flex items-center mb-8">
|
||||
← 返回任務列表
|
||||
|
||||
Reference in New Issue
Block a user