rsshub
Version:
Make RSS Great Again!
41 lines (40 loc) • 1.55 kB
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as cache_default } from "./cache-CiDoUSLo.mjs";
import { load } from "cheerio";
//#region lib/routes/blowstudio/work.ts
const route = {
path: "/",
categories: ["design"],
example: "/blowstudio",
name: "Home",
maintainers: ["MisteryMonster"],
handler
};
async function handler() {
const rootUrl = "https://www.blowstudio.es";
const $ = load(await rofetch(`${rootUrl}/work/`));
const list = $(".portfolios.normal > ul > li").toArray().slice(0, 10);
const videostyle = "width=\"640\" height=\"360\"";
const imgstyle = "style=\"max-width: 650px; height: auto; object-fit: contain; flex: 0 0 auto;\"";
return {
title: "Blow Studio",
link: rootUrl,
item: await Promise.all(list.map((item) => {
const link = `${rootUrl}${$(item).find("a").attr("href")}/`;
return cache_default.tryGet(link, async () => {
const $2 = load(await rofetch(link));
const mainvideo = $2(".single-page-vimeo-div").attr("data-video-id");
let content = `<iframe ${videostyle} src='https://player.vimeo.com/video/${mainvideo}' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br>`;
content += $2("div.portfolio-content > div:nth-child(2)").html();
for (const img of $2("div.attachment-grid img").toArray()) content += `<img ${imgstyle} src="${$2(img).attr("src")}"><br>`;
return {
title: $2("div.portfolio-content > div:nth-child(1)").text(),
description: content,
link
};
});
}))
};
}
//#endregion
export { route };