1
0
Fork 0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2026-03-07 05:01:36 +00:00

Create post viewer

This commit is contained in:
Cadence Fish 2020-01-19 04:38:14 +13:00
parent 693c083a99
commit 59d891b94b
No known key found for this signature in database
GPG key ID: 81015DF9AA8607E1
19 changed files with 479 additions and 84 deletions

View file

@ -1,5 +1,6 @@
function proxyImage(url) {
function proxyImage(url, width) {
const params = new URLSearchParams()
if (width) params.set("width", width)
params.set("url", url)
return "/imageproxy?"+params.toString()
}

View file

@ -1,6 +1,7 @@
const fetch = require("node-fetch").default
function request(url) {
console.log("-> [OUT]", url) // todo: make more like pinski?
return fetch(url, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"