Skip to content

Instantly share code, notes, and snippets.

import axios from 'axios';
import * as cheerio from 'cheerio';
import * as iconvLite from 'iconv-lite';
export const fetchHtml = async (webUrl: string) => {
try {
const { data: htmlBuffer, headers } = await axios.get(webUrl, {
responseType: 'arraybuffer',
headers: {
'User-Agent':
// browser
export const fetchResourceByUrl = async (url: string) => {
const res = await fetch(url);
const contentType = res.headers.get("content-type");
const filename = url.substring(url.lastIndexOf("/") + 1);
const blob = await res.blob();
if (contentType) {
return new File([blob], filename, { type: contentType });
}
@hexianga
hexianga / .Cloud.md
Created June 6, 2023 05:33 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合