Skip to content

Instantly share code, notes, and snippets.

@judell
Created December 6, 2022 02:58
Show Gist options
  • Save judell/a278ce0c49f5bcf670b392cd21c7ace9 to your computer and use it in GitHub Desktop.
Save judell/a278ce0c49f5bcf670b392cd21c7ace9 to your computer and use it in GitHub Desktop.
find followers and follows not on lists
with data as (
select
l.title as list,
a.*
from
mastodon_list l
join
mastodon_list_account a
on
l.id = a.list_id
),
no_list_following as (
select
d.list,
f.id,
f.username,
f.display_name
from
mastodon_following f
left join
data d
on
f.id = d.id
where
list is null
),
no_list_followers as (
select
d.list,
f.id,
f.username,
f.display_name
from
mastodon_followers f
left join
data d
on
f.id = d.id
where
list is null
)
select * from no_list_following
union
select * from no_list_followers
order by id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment