@alex Interesting. I didn't know all of this.
I frankly believe that a single website to view trends, or perhaps work as an API, would be the best option. I feel like a script that reads all the toots in the timeline should be able to scan the hashtags and sort them fairly quickly. Right? Shouldn't be too hard to do in #JavaScript.
@realcaseyrollins For each new tashtag it discovers, it will get slower to sort the entire list. Also, what’s the cutoff point? We have to store a date with each hashtag too, and we want to count occurrences of that tag from today but not occurrences of that tag from yesterday. Sorting them and pruning the old ones is too slow to happen every time someone loads the trending panel. So we need multiple layers of cache with background processes that automatically update them.
Mastodon just prunes it at 12am midnight UTC every day. So if you ever visit in the morning and there’s no trends, that’s why. It’s not from the past 24 hours, it’s trends since 12am UTC.
@alex Ahhh I see. I was thinking it should remake the list of hashtags every time it refreshes and only look at the posts from the past 48-72 hours...I'm not sure why it would be important to store hashtags that haven't been used in a month if the point is to see what's trending right at the moment.
@realcaseyrollins In theory this is what we want to happen, it’s just a slow operation. You can either run a background task to keep crunching it and update the cache automatically, or manipulate cached counter how Mastodon does it. There are pros and cons to each way but neither is ideal.
@alex A friend of mine who's no longer on the fedi made a page like that, he gave me the code so I could look at it. It worked pretty well, there was even the potential to see the local trends of every single instance. The only issue is, it included bot posts.
Unfortunately the page isn't up anymore but I have the code still so I might be able to put it up somewhere when I get time
I think the #JavaScript code could even be used as an API if that would be preferable to having it built into every instance
@lain @realcaseyrollins Makes sense. In the case of Spinster I made trends local-only, and I think that brought some value, by makings tags like #bookclub easier to find (although we did also get #FreeSquiddy, which was not good).
There are probably better ways to increase discoverability. But I fear they will all have this problem of needing some manual curation.
@derek @lain @alex It really wouldn't be that hard to do
https://stackoverflow.com/questions/10473745/compare-strings-javascript-return-of-likely
@derek @lain @alex Man y'all are literally motivating me to change my friend's code and make an API to prove y'all wrong. I'm 100% sure this can be done quite simply using #JavaScript
@realcaseyrollins @lain The top trends will always be #nsfw and #animearmpits thanks to dielan’s bots
@realcaseyrollins @lain Ah so you mean it requires some manual curating? 😛
@realcaseyrollins @lain My idea at this point for trends in Pleroma is config options like “Trends are local-only” vs “Trends show everything and I accept the consequences” vs “Disabled”
@alex@gleasonator.com @lain@lain.com @realcaseyrollins@gameliberty.club i'm not sure how misskey handles trend.
it looks like its just locally keeping track of it based on what it happens to see.
still not sure about these 'Relays' .
i suppose they are for helping out with federation or something but i don't know of any to add.
its like a discovery tool that also needs to be discovered itself.
@lain @realcaseyrollins I wish I’d read this blog post sooner: https://blog.soykaf.com/post/postgresql-elixir-troubles/
Lots of info about querying hashtags. Also makes me wonder about the Flake ID migration issue… maybe I’ll write a blog post if I ever figure out why. 😆
@alex @lain @realcaseyrollins I love this writing style, that efficiently provides both humor and education on normally inaccessible topics
@realcaseyrollins Yeah it’s a thing people ask for a lot, but nobody in Pleroma wants to do because Mastodon’s implementation caused a lot of problems.
I will probably add it at some point, with some configuration options. It will be hard though. There’s no way to query that data quickly, so we have to store a cache of all incoming tags and then sort them. Even Mastodon’s algorithm doesn’t order these tags properly, it has a minimum threshold (10 statuses) after which it takes the top 5 by order of insertion… so the most active hashtag might not even show up on the list.