Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(route/meta): add AI at Meta Blog #17408

Closed
wants to merge 17 commits into from
Prev Previous commit
Next Next commit
(hopefully) fix search
canonnizq committed Oct 28, 2024
commit 0c3c75b67a5cf797e2144a78bcb3e571b1745502
12 changes: 6 additions & 6 deletions lib/routes/aimeta/blog.ts
Original file line number Diff line number Diff line change
@@ -16,16 +16,16 @@ export const route: Route = {
async function handler() {
const baseUrl = 'https://ai.meta.com';

const response = await ofetch(`${baseUrl}/blog`);
const response = await ofetch(`${baseUrl}/blog/`);
const $ = load(response);

const items = $('div._ams_')
.toArray().map((item) => ({
category: $(item).children('p._amt0').text(),
link: $(item).children('a._amt1').attr('href'),
title: $(item).children('a._amt1').children('p._amt2').text(),
description: $(item).children('p._4ik4._4ik5').children('p._amt3').text(),
pubDate: parseDate($(item).children('p._amt4').text())
category: $(item).find('p._amt0').text(),
link: $(item).find('a._amt1').attr('href'),
title: $(item).find('a._amt1 p._amt2').text(),
description: $(item).find('div._4ik4._4ik5 p._amt3').text(),
pubDate: parseDate($(item).find('p._amt4').text())
}));

return {