mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-05-29 17:37:17 +09:00
Happy typings
This commit is contained in:
parent
7a28b44d44
commit
9212319fc5
@ -28,7 +28,7 @@ export default async (url: URL.Url): Promise<Summary> => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const $: client.CheerioStaticEx = res.$;
|
const $ = res.$;
|
||||||
|
|
||||||
let title =
|
let title =
|
||||||
$('meta[property="og:title"]').attr('content') ||
|
$('meta[property="og:title"]').attr('content') ||
|
||||||
|
@ -23,11 +23,11 @@ export function test(url: URL.Url) {
|
|||||||
|
|
||||||
export async function summary(url: URL.Url) {
|
export async function summary(url: URL.Url) {
|
||||||
const res = await client.fetch(url.href);
|
const res = await client.fetch(url.href);
|
||||||
const $: client.CheerioStaticEx = res.$;
|
const $ = res.$;
|
||||||
|
|
||||||
const title: string = $('#title').text();
|
const title = $('#title').text();
|
||||||
|
|
||||||
const description: string =
|
const description =
|
||||||
$('#productDescription').text() ||
|
$('#productDescription').text() ||
|
||||||
$('meta[name="description"]').attr('content');
|
$('meta[name="description"]').attr('content');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user