1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
export async function nyt(req: express.Request, res: express.Response) {
const data = await fetchText(
"https://cn.nytimes.com/",
{
headers: {
origin: "https://cn.nytimes.com",
referer: "https://cn.nytimes.com",
"User-Agent":
"Mozilla/5.0 (Linux; Android 10; LIO-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.136 Mobile Safari/537.36",
},
},
);
return res.send(data);
}