Conversation
Notices
-
:blank: (i@declin.eu)'s status on Tuesday, 08-Aug-2023 05:10:32 JST :blank: thinking of doing federation crimes again - likes this.
- repeated this.
-
:blank: (i@declin.eu)'s status on Tuesday, 08-Aug-2023 06:17:33 JST :blank: surely no one will mind me fetching their public posts :)
def dig(url, count) do if count > 0 do IO.puts("getting #{count} #{url}") case Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id(url) do {:ok, %{"next" => more, "orderedItems" => items}} -> dig(more, count - Enum.count(items)) _ -> "done" end end end def run(["userfill", nickname, max]) do start_pleroma() with %User{} = user <- User.get_cached_by_nickname(nickname) do dig("#{user.ap_id}/outbox?page=true", String.to_integer(max)) else _ -> shell_error("No user #{nickname}") end end def run(["instancefill", instance, max]) do start_pleroma() from(u in Pleroma.User, where: like(u.nickname, ^"%#{instance}"), select: u.nickname ) |> Pleroma.Repo.all() |> Enum.each(fn nickname -> with %User{} = user <- User.get_cached_by_nickname(nickname) do dig("#{user.ap_id}/outbox?page=true", String.to_integer(max)) else _ -> shell_error("No user #{nickname}") end end) end def run(["everythingfill", max]) do start_pleroma() from(u in Pleroma.User, where: u.last_refreshed_at >= ago(1, "month"), where: not like(u.nickname, ^"%relay%") ) |> Pleroma.Repo.chunk_stream(10, :batches) |> Stream.each(fn users -> Task.async_stream( users, fn usr -> with %User{} = user <- User.get_cached_by_nickname(usr.nickname) do dig("#{user.ap_id}/outbox?page=true", String.to_integer(max)) end end, on_timeout: :kill_task ) |> Stream.run() end) |> Stream.run() end
#AGP compliance likes this. -
(mint@ryona.agency)'s status on Tuesday, 08-Aug-2023 06:28:01 JST @i I feel like you'd run into ratelimits very soon. Also, doesn't fetch_and_contain_remote_object_from_id do nothing with objects besides just getting them from server? They don't get into the database. -
pomstan (pomstan@xn--p1abe3d.xn--80asehdb)'s status on Tuesday, 08-Aug-2023 06:31:10 JST pomstan "#{user.ap_id}/outbox?page=true"
aren’t you supposed to properly resolve user outbox via AP mechanisms, or do you not care about non-pleroma software?
likes this. -
:blank: (i@declin.eu)'s status on Tuesday, 08-Aug-2023 06:32:12 JST :blank: @mint it's not a serious thing, also thanks for the catch, gonna have to bug fix it when i decide to run it to completion for real likes this. -
(mint@ryona.agency)'s status on Tuesday, 08-Aug-2023 06:37:17 JST @i @pomstan From all my tests, only friendica has different inbox/outbox path (https://friendica.tld/outbox/username), the rest (pleromer, mastodon, gts, honk, pisskey) put it right in %AP_ID%/outbox. -
:blank: (i@declin.eu)'s status on Tuesday, 08-Aug-2023 06:37:18 JST :blank: @pomstan there is only one mastodon, and two software i've checked that do the same thing as mastodon, good enough for shitpost for now