Twitterのプレビューができなくなっているのを修正 (#135)

* SummalyBot

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

View File

@ -9,12 +9,14 @@ import { AllHtmlEntities } from 'html-entities';
const entities = new AllHtmlEntities();
import * as client from 'cheerio-httpcli';
// 単一インスタンスなのでamazonと値を揃えないといけない
client.set('headers', {
'User-Agent': `${name}/${version}`
'User-Agent': `SummalyBot/${version}`
});
client.set('referer', false);
client.set('timeout', 10000);
client.set('maxDataSize', 5 * 1024 * 1024);
client.set('maxDataSize', 10 * 1024 * 1024);
import Summary from './summary';

View File

@ -4,11 +4,11 @@ import * as client from 'cheerio-httpcli';
import summary from '../summary';
client.set('headers', {
'User-Agent': `${name}/${version}`
'User-Agent': `SummalyBot/${version}`
});
client.set('referer', false);
client.set('timeout', 10000);
client.set('maxDataSize', 5 * 1024 * 1024);
client.set('maxDataSize', 10 * 1024 * 1024);
export function test(url: URL.Url): boolean {
return url.hostname === 'www.amazon.com' ||