This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto') | |
const bigInt = require('big-integer') | |
// we need big-integer as the numbers that we're dealing with are too big for JS' default numbers | |
function sha256(data) { | |
// creates a sha256 hash, updates it with data, and turns it into a bigint | |
var hash = crypto.createHash('sha256').update(data).digest('hex') | |
return bigInt(hash,16) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
AppBskyEmbedVideo, | |
AppBskyVideoDefs, | |
AtpAgent, | |
BlobRef, | |
} from "npm:@atproto/api"; | |
const userAgent = new AtpAgent({ | |
service: prompt("Service URL (default: https://bsky.social):") || | |
"https://bsky.social", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AppBskyEmbedVideo, AtpAgent } from "npm:@atproto/api"; | |
const userAgent = new AtpAgent({ | |
service: prompt("Service URL (default: https://bsky.social):") || | |
"https://bsky.social", | |
}); | |
await userAgent.login({ | |
identifier: prompt("Handle:")!, | |
password: prompt("Password:")!, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
AppBskyEmbedVideo, | |
AppBskyVideoDefs, | |
AtpAgent, | |
BlobRef, | |
} from "npm:@atproto/api"; | |
const userAgent = new AtpAgent({ | |
service: prompt("Service URL (default: https://bsky.social):") || | |
"https://bsky.social", |