From 8c34d810af95fae0ef846f54370a8c88bfab7123 Mon Sep 17 00:00:00 2001 From: "netop://ウィビ" Date: Sat, 11 Apr 2026 14:24:49 -0700 Subject: initial commit --- remarks/WR-006.txt | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 remarks/WR-006.txt (limited to 'remarks/WR-006.txt') diff --git a/remarks/WR-006.txt b/remarks/WR-006.txt new file mode 100644 index 0000000..0d034ab --- /dev/null +++ b/remarks/WR-006.txt @@ -0,0 +1,70 @@ + + + + + + + +Document: WR-006 P. Webb + 2024.11.12 + + Export your Farcaster posts + +Body + + I recently decided to quit Farcaster for several reasons. You can + read about them in the `elon-mind-virus.txt` post. Anyhoo, here's the + Deno script I made, adapted from Neynar's Node.js archiver script[1]: + + ```ts + /*** IMPORT ------------------------------------------- ***/ + + import { appendFile } from "node:fs"; + import { NeynarAPIClient } from "npm:@neynar/nodejs-sdk"; + + /*** UTILITY ------------------------------------------ ***/ + + const client = new NeynarAPIClient("YOUR_NEYNAR_API_KEY"); + const fid = 16152; /// your Farcaster FID + + const dumpCast = (cast) => { + const data = `${JSON.stringify(cast)}\n`; + + appendFile(`${fid}_export.ndjson`, data, (err) => { + if (err) + throw err; + + console.log(`${cast.hash} processed`); + }); + }; + + const fetchAndDump = async(fid, cursor) => { + const data = await client.fetchAllCastsCreatedByUser(fid, { + cursor, + limit: 150 + }); + + data.result.casts.map(dumpCast); + + if (data.result.next.cursor === null) + return; /// if no cursor, fin + + await fetchAndDump(fid, data.result.next.cursor); + }; + + /*** PROGRAM ------------------------------------------ ***/ + + fetchAndDump(fid); + + /*** deno run --allow-env --allow-net --allow-write export_farcaster.ts ***/ + ``` + + This will only export your public posts, not your DMs. If you don't + want to pay Neynar[2], you can use these[3] projects[4]. + +References + + [1] + [2] + [3] + [4] -- cgit v1.2.3