mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-06-03 11:57:27 +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') ||
|
||||
'/favicon.ico';
|
||||
|
||||
const sensitive = $('.tweet').attr('data-possibly-sensitive') === 'true'
|
||||
|
||||
const find = (path: string) => new Promise<string>(done => {
|
||||
const target = URL.resolve(url.href, path);
|
||||
request.head(target, (err, res) => {
|
||||
@ -148,6 +150,7 @@ export default async (url: URL.Url, lang: string = null): Promise<Summary> => {
|
||||
width: playerWidth || null,
|
||||
height: playerHeight || null
|
||||
},
|
||||
sitename: siteName || null
|
||||
sitename: siteName || null,
|
||||
sensitive,
|
||||
};
|
||||
};
|
||||
|
@ -28,6 +28,11 @@ type Summary = {
|
||||
* The title of that web page
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* Possibly sensitive
|
||||
*/
|
||||
sensitive?: boolean;
|
||||
};
|
||||
|
||||
export default Summary;
|
||||
|
Loading…
x
Reference in New Issue
Block a user