# a utility script used to explore my fediverse followers (import spork/json) (use judge) (defn read-from-file [file-path] "read data from a file, not super safe or fault tolerant." (let [f (file/open file-path :r) content (file/read f :all)] (file/close f) content)) (def json-data (read-from-file "followers.json")) # this is just a small sample export, will have to use curl to get the full list beyond the first 80 (def all-followers (json/decode json-data)) # this seems horribly inefficient # TODO: is there a clever way to deal with this? # maybe a filter? # (filter (fn [x] (> x 2)) [1 2 3 4 5]) # @[3 4 5] # or maybe keep? # https://janetdocs.com/keep (defn select-by-key [key arr] "select a value by matched key." (def a @[]) (each follower arr (loop [[k v] :pairs follower] (if (= k key) (array/push a v)))) a) (def follower-accounts (select-by-key "acct" all-followers)) (def follower-usernames (select-by-key "username" all-followers)) (test (select-by-key "acct" all-followers) @["brendan@merveilles.town" "balrogboogie@mastodon.art" "mstange@mastodon.social" "mario_afk@merveilles.town" "hanbruder@ecoevo.social" "angelo@social.droppedbits.com" "akkartik@lethallava.land" "kategenevieve@assemblag.es" "kidskylark" "saltimbanque@mamot.fr" "dcreager@dcreager.net" "computersandblues@post.lurk.org" "tamberg@quite.social" "hs0ucy@jasette.facil.services" "prahou@merveilles.town" "nix@merveilles.town" "cidney@social.city-of-glass.net" "alyssa@cloudisland.nz" "hastur@hackers.town" "cian@post.lurk.org" "ben@a11y.info" "jeremy@boles.social" "pkra@bonn.social" "typeable@mastodon.social" "nocko@kolektiva.social" "ioezg@emacs.ch" "jleightcap@treehouse.systems" "arcade@catcatnya.com" "illegaldaydream@kolektiva.social" "maro@merveilles.town" "halfflat@calckey.social" "julienxx@nein.club" "required@zero.parts" "lior@mastodon.social" "Amirography@fosstodon.org" "decentral1se@varia.zone" "mirth@mastodon.sdf.org" "tbsp@merveilles.town" "plexus@toot.cat" "cblgh@merveilles.town" "spiralganglion@mastodon.social" "booters@kolektiva.social" "thegr8whoopdini@bookwyrm.social" "pixx@merveilles.town" "angelo@social.lol" "HarneyB@decept.org" "woozong@post.lurk.org" "sieve@hachyderm.io" "amszmidt@mastodon.social" "karlinfox@mastodon.cloud" "resoluxe@mastodon.art" "idlestate@toot.cat" "fmflake@mastodon.social" "raychill@aus.social" "selmakovich@eldritch.cafe" "bartgo@fosstodon.org" "GoodClover@en.osm.town" "levibeach@merveilles.town" "celebrion@mastodon.online" "benji@fosstodon.org" "nilmethod@pleroma.destroyallmachines.net" "nikken@post.lurk.org" "lobo@merveilles.town" "ophiuchoid@indieweb.social" "mu@merveilles.town" "kieranmcguire@mastodon.online" "yagaruma@mastodon.social" "dook@post.lurk.org" "wilfredh@mastodon.social" "Jetengineweasel@hackers.town" "DrTCombs@transportation.social" "jy4m@matapacos.dog" "ivmirx@mas.to" "vanja@tech.lgbt" "abuseofnotation@mathstodon.xyz" "jes5199@mastodon.social" "ouro@social.snircle.space" "typeswitch@gamedev.lgbt" "Ronkjeffries@mastodon.social" "bogmon@mstdn.social"])