mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-06-08 20:58:03 +09:00
sensitive flag (#133)
This commit is contained in:
parent
7cfb711167
commit
3b46217ffe
@ -99,6 +99,8 @@ export default async (url: URL.Url, lang: string = null): Promise<Summary> => {
|
|||||||
$('link[rel="icon"]').attr('href') ||
|
$('link[rel="icon"]').attr('href') ||
|
||||||
'/favicon.ico';
|
'/favicon.ico';
|
||||||
|
|
||||||
|
const sensitive = $('.tweet').attr('data-possibly-sensitive') === 'true'
|
||||||
|
|
||||||
const find = (path: string) => new Promise<string>(done => {
|
const find = (path: string) => new Promise<string>(done => {
|
||||||
const target = URL.resolve(url.href, path);
|
const target = URL.resolve(url.href, path);
|
||||||
request.head(target, (err, res) => {
|
request.head(target, (err, res) => {
|
||||||
@ -148,6 +150,7 @@ export default async (url: URL.Url, lang: string = null): Promise<Summary> => {
|
|||||||
width: playerWidth || null,
|
width: playerWidth || null,
|
||||||
height: playerHeight || null
|
height: playerHeight || null
|
||||||
},
|
},
|
||||||
sitename: siteName || null
|
sitename: siteName || null,
|
||||||
|
sensitive,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -28,6 +28,11 @@ type Summary = {
|
|||||||
* The title of that web page
|
* The title of that web page
|
||||||
*/
|
*/
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possibly sensitive
|
||||||
|
*/
|
||||||
|
sensitive?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Summary;
|
export default Summary;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user