Create post viewer

This commit is contained in:
Cadence Fish
2020-01-19 04:38:14 +13:00
parent 693c083a99
commit 59d891b94b
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"