lol rip, I ran out of monthly credits for the Mastodon server I run, digipres.club. Got to start paying actual money I guess.
i know where you can get some on aldhani

Unholy Vessel
lol rip, I ran out of monthly credits for the Mastodon server I run, digipres.club. Got to start paying actual money I guess.
i know where you can get some on aldhani
Tomorrow (Saturday the 17th) at 2 PM EST / 11 AM PST I'm streaming "Tunic" on Twitch. This is the second session in a row JUST trying to find page 22 of the manual. But, last week we found a large number of places page 22 isn't! So that's progress.
Watch at: https://twitch.tv/mcc111
Like this second! Come watch me DEFINITELY find page 24 this time for certain: http://twitch.tv/mcc111
Don't think I posted about this here: on Saturday 12/17 (tomorrow!), I'm doing all-day streaming marathon to raise money for Trans Lifeline! For every $5 raised, I have to play one minute of Dizzy. We are already at over three hours of Dizzy. This is gonna be a mess. Please stop by and donate!
Starting now! It's DIZZY TIME twitch.tv/obscuritory
theres an option to extract the source maps that needs a certain npm package installed, and theres an option to list all the trpc api endpoints.
a helpful file to check out for anyone interested in the api is sitemap.ts because it contains all the /api/v1 endpoints and what data they take.
also heads up i am not a lawyer, i am not telling you to use this to do anything malicious or against TOS! the only cybercrimes i commit are css crimes
sorry that the code is a bit of a mess, it was made for just me to use at first but i figured sharing anything is better than sharing nothing
// run this file with `deno run --allow-net --allow-write --allow-run main.js`
// write to files then extract with shuji
// this needs to have a specific branch of shuji installed
// this can be done with `npm install mazamachi/shuji#add-preserve-option -g`
const extract = true
const listTRPCEndpoints = false
if (extract) {
try {
await Deno.remove('static', { recursive: true });
}
catch (e) {
undefined
//console.log(e)
}
}
const rootUrl = 'https://cohost.org/'
// get the runtime.*.js url
const html = await fetch(rootUrl).then(res => res.text())
// console.log(html)
const runtimeUrlRE = /static\/runtime\.\S{20}\.js/gm
const runtimeUrl = html.match(runtimeUrlRE)[0]
const clientUrlRe = /static\/client\.\S{20}\.js/gm
const clientUrl = html.match(clientUrlRe)[0]
// console.log(runtimeUrl)
// get the webpack chunk info from runtime.*.js
// console.log(rootUrl + runtimeUrl)
const runtime = await fetch(rootUrl + runtimeUrl).then(res => res.text())
// console.log(runtime)
const webpackChunkInfoRE = /function\(\w+\){return\((.*?}).*({.*}).*\+"\.js"}/gm
const webpackChunkInfoRaw = webpackChunkInfoRE.exec(runtime)
// console.log(webpackChunkInfoRaw)
const prefixes = (new Function(`return ${webpackChunkInfoRaw[1]}`))()
const suffixes = (new Function(`return ${webpackChunkInfoRaw[2]}`))()
// combine the prefixes and suffixes to get the webpack chunk urls
const ids = Object.keys(suffixes)
const webpackChunkUrls = ids.map(id => {
const prefix = prefixes[id] || id
const suffix = suffixes[id]
return `static/${prefix}.${suffix}.js`
})
webpackChunkUrls.push(clientUrl)
// get the webpack chunk contents
// const webpackChunkContents = await Promise.all(webpackChunkUrls.map(url => fetch(rootUrl + url).then(res => res.text())))
// get the sourcemap urls
const sourcemapUrls = webpackChunkUrls.map(url => url + '.map')
// get the sourcemap contents
const sourcemapContents = (await Promise.all(sourcemapUrls.map(url => fetch(rootUrl + url).then(res => res.json()))))
if (extract) {
for (let i = 0; i < sourcemapUrls.length; i++) {
const url = sourcemapUrls[i]
const contentRaw = sourcemapContents[i]
contentRaw.sources = contentRaw.sources.map(path => {
if (path.startsWith('webpack://')) return path.split('webpack://').at(-1)
return path
})
const content = JSON.stringify(contentRaw)
// console.log(url.split("/").slice(0, -1).join(''))
await Deno.mkdir(url.split("/").slice(0, -1).join(''), { recursive: true })
try {
await Deno.writeTextFile(`${url}`, content, { create: true })
}
catch (e) {
console.log(e)
}
// const p = Deno.run({
// cmd: ['shuji', '-p', '-o', 'cohost', 'static'],
// // stdout: 'piped',
// // stderr: 'piped',
// })
// console.log(await p.status())
// console.log(await p.output())
}
await Deno.remove('cohost', { recursive: true });
const p = Deno.run({
cmd: ['shuji', '-p', '-o', 'cohost', 'static'],
// stdout: 'piped',
// stderr: 'piped',
})
console.log(await p.status())
}
if (listTRPCEndpoints) {
const sourceMapTextContents = sourcemapContents.map(s => s.sourcesContent.join('\n'))
// console.log(sourcemapContents)
const re = /(trpc\.(\S+\.)+?use(Query|Mutation)|trpcLegacy\.use(Query|Mutation)[\S\s]*?"[\S\s]*?")/gm
const matches = []
for (const sourcemapContent of sourceMapTextContents) {
let match;
while ((match = re.exec(sourcemapContent)) !== null) {
matches.push(match)
}
}
let out = matches.map(m => m[0])
// remove duplicates
out = [...new Set(out)].sort()
console.log(out)
console.log(JSON.stringify(out, null, 2))
}