toddsundsted/ktistec

Question: How do I get the number of followers I had at a particular date?

vrthra opened this issue · 3 comments

vrthra commented

I am curious about the change in followers over time. What is the best way to do this? (I am happy to run an SQL query on the Ktistec db).

@vrthra the following will get you all of the follow relationships from someone to you:

sqlite> .mode column
sqlite> .headers on
sqlite> select * from relationships where type = "Relationship::Social::Follow" and to_iri = "https://social.gopinath.org/actors/rahul";
id      created_at               updated_at               type                          from_iri                                                  to_iri                                      confirmed  visible
------  -----------------------  -----------------------  ----------------------------  --------------------------------------------------------  ------------------------------------------  ---------  -------
...

you can pretty easily bin up the followers by the date/time they were created, which will give you a picture of growth.

a slightly different way to look at it is the number of inbound follow requests:

select * from activities where type = "ActivityPub::Activity::Follow" and object_iri = "https://social.gopinath.org/actors/rahul";
id      created_at               updated_at               type                           iri                                                                                      visible  published                actor_iri                                                 object_iri                                  target_iri  to                                                                cc  summary  undone_at
------  -----------------------  -----------------------  -----------------------------  ---------------------------------------------------------------------------------------  -------  -----------------------  --------------------------------------------------------  ------------------------------------------  ----------  ----------------------------------------------------------------  --  -------  -----------------------
...
vrthra commented

Thank you! Much appreciated.