Yet another way to address the followTag issue

In regards to the implementation of a feature to federate public posts or at least fetch posts by tags. I am not a ruby developer and I am new to ActivePub protocol so I can’t help right now implementing, I’ll have to learn first…
The idea has been around for a long time, there are long posts about public posts federation, relay servers, pros and cons already, this one is about another possible idea to workaround the problem.

Basically, the whole idea could be divided in 3 features working together.

  1. New feature :: fetchActivePodsList. Instead of having a centralised uptime source like https://podupti.me, the pods could get an initial seed list of pods to communicate to and mutually exchange an up to date list of active pods regularly.
    They would not exchange data much data, just a "hello* here and there, compare their hash and update their list if need be.

  2. New feature:: fetchSubscriptionList . The idea is to find people with common interests quicker across any pod.

Existing users could simply use the existing feature and define their profile with appropriate high level tags ie #art #dev #music,etc…

Currently, when querying the /tags/{tag} on a given pod, it returns a list of users who associate themselves with the given tag when it has encountered them ie downloaded their profiles ( which goes without saying when the queried pod is the one hosting a given profile).

Fetching that list is not really practical at the moment, On large pods for instance, the lists returned per tag can be quite large and many handles are inactive.

So instead ( new feature ) , each pod could share a list of active people for related tags. Limiting to top 20 active users for instance ( by focusing on active high posters, it is easy for someone to meet less active people later on), would help capping the size of such table even thought long term it would not be scalable.

  1. New feature:: ascpect_memberships auto-enrolment : Once people profiles have been downloaded. The pod could create a new aspect and add the retrieved users to it automatically.

Example : I create a profile and add the tag #music to the profile section. The pod mark my person_id to the subscription table and fetches the related subscription list on other pods unless it has not changed, Then it searches people in these lists using the already existing search feature and collects their last 15top posts ( this is what the search feature does currently) . NOTE: These posts would not necessarily be related to the tag but there is a high chance that some of them do. Then the pod would create a new aspect for the user and auto-enrol the retrieved users to it.

This is not an accurate method I totally agree but in practice it actually works for generic tags like #music, #art, … Basically high level tags one would used to define one’s most important interests.
I actually did that manually and it worked, I went and fetched handles tagged with #music from all the active pods on podupti.me. I got a list of around 4000 users. I automated the process of searching for them on my pod lab and I got lots of music in the public feed tagged or not with #music. NOTE: There was a lot of inactive handles and posts spanned from 5 years ago up to now.
Then I added them automatically to my contacts and my stream looks like a webradio right now :slight_smile:

1 Like

For reference, this is what I used to fetch handles based on profile tags:

for tag in music caturday mywork diaspora newhere nature facebook twitter; do time (max=5;for pod in `curl -k https://podupti.me/ 2>/dev/null | egrep -o "domain=[^\"]+\"" | sed -r "s/domain=([^\"]+)\"/\1/"`;do echo "checking $pod.." >&2 ;maxpage=`curl -k https://${pod}/tags/${tag} 2>/dev/null | egrep pagination | sed -r "s/.+\?page=(.+)\".+next next_page.+/\1/g"`; [[ $maxpage -ge 1 ]] && for (( i=1; i<=$maxpage; i++ ));do curl -k https://${pod}/tags/${tag}?page=$i 2>/dev/null | egrep -A 1 "info diaspora_handle" |egrep -v "div class=|--";done;done | sort | uniq > userlist_$tag);done

Then using any given non-empty resulting userlist_tag list, you tell the pod to search for them.

import diaspy

host="https://yourpoddomain"
username='user'
password='pwd'
fname='userlist_music'

print "Connecting to server %s" % host

c = diaspy.connection.Connection(pod=host,username=username,password=password)
c.login()


search= diaspy.search.Search(c)

with open(fname) as f:
    content = f.readlines()
content = [x.strip() for x in content]


for handle in content:
	search.lookupUser(handle)

The above script updates the people table with related pods rsa key, person_id and related diaspora_handle. The pod also pulls the last 15 posts for each user.

Finally I just used web developer feature in Firefox to build a curl query to add contacts to aspect. NOTE: that feature is broken in diaspy.
Scripting is easy, you just need to pull the person_id from people for each searched user

POST /aspect_memberships… ‘{“aspect_id”:12,“person_id”:5}’

where 5 is the id for a given user in the people table.