sensitive flag (#133)

This commit is contained in:
MeiMei 2020-06-02 10:53:42 +09:00 committed by GitHub
parent 7cfb711167
commit 3b46217ffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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,
};
};

View File

@ -28,6 +28,11 @@ type Summary = {
* The title of that web page
*/
title: string;
/**
* Possibly sensitive
*/
sensitive?: boolean;
};
export default Summary;