test: add some testing and prototype

このコミットが含まれているのは:
sinkaroid 2023-04-18 11:19:14 +07:00
コミット da29c28949
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: ABD69470B2390135
1個のファイルの変更20行の追加0行の削除

20
test/mock.ts ノーマルファイル
ファイルの表示

@ -0,0 +1,20 @@
import p from "phin";
import { load } from "cheerio";
const url = "https://www.pornhub.com/view_video.php?viewkey=ph63c4e1dc48fe7";
async function test() {
const res = await p({
url: url,
"headers": {
"User-Agent": process.env.USER_AGENT || "lustpress/1.6.0 Node.js/16.9.1",
},
});
const $ = load(res.body);
const title = $("meta[property='og:title']").attr("content");
console.log(title);
console.log(res.statusCode);
}
test().catch(console.error);