There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lemmyverse: find communities from the command line

lemmyverse: search lemmy communities from the command-line. Thanks to the data HTTP API from lemmyverse.net! This is not really as polished as I like but, hey, in the interest of having a lively Lemmy I thought I’d share anyway :)

Usage

lemmyverse searches community names and descriptions using a regular expression:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">lemmyverse pattern
</span>

Find communities about motorcycles:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">$ lemmyverse motorcycle
</span><span style="color:#323232;">[email protected]      All Things motorcycles
</span><span style="color:#323232;">[email protected]   All Things motorcycles
</span><span style="color:#323232;">[email protected]     All Things motorcycles
</span><span style="color:#323232;">[email protected] Community for BMW motorcycles. A place to share
</span><span style="color:#323232;">[email protected]       A community to discuss all things BMW cars & motorcycles.nFeel free to show off your new vehicle/parts
</span><span style="color:#323232;">[email protected]       A discussion area for Buell motorcycles.
</span><span style="color:#323232;">[email protected]        A community for pictures and videos of people using motorcycles to transport things in a creative manner.nnThis includes
</span><span style="color:#323232;">[email protected]   This community is for all things motorcycle related. At a later point and with enough traction gained
</span><span style="color:#323232;">...
</span>

Find communities for the Plan 9 operating system:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">$ lemmyverse '(plan9)|(Plan 9)'
</span><span style="color:#323232;">[email protected]     Discussions on the Plan9 operating system.
</span>

Why?

I run relatively slow hardware and I’m travelling in Bali, Indonesia at the moment. Loading lemmyverse.net in a web browser takes ages and gets the laptop fans spinning (it’s hot here!). So I had some fun creating a tiny command-line program to find Lemmy communities using classic UNIX tools awk(1), tr(1), grep(1) etc.

More info

See the man page:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">LEMMYVERSE(1)               General Commands Manual              LEMMYVERSE(1)
</span><span style="color:#323232;">
</span><span style="color:#323232;">NAME
</span><span style="color:#323232;">     lemmyverse - find lemmy communities
</span><span style="color:#323232;">
</span><span style="color:#323232;">SYNOPSIS
</span><span style="color:#323232;">     lemmyverse pattern
</span><span style="color:#323232;">
</span><span style="color:#323232;">DESCRIPTION
</span><span style="color:#323232;">     lemmyverse finds Lemmy communities indexed by lemmyverse.net using the
</span><span style="color:#323232;">     given regular expression as interpreted by grep(1).  Both the names and
</span><span style="color:#323232;">     descriptions of the communities are searched.
</span><span style="color:#323232;">
</span><span style="color:#323232;">     On first run, a local community database must be generated.  The full
</span><span style="color:#323232;">     community index is downloaded from https://lemmyverse.net using curl(1),
</span><span style="color:#323232;">     transformed, then stored in the user cache directory.  To regenerate the
</span><span style="color:#323232;">     database, remove the file and run lemmyverse again.
</span><span style="color:#323232;">
</span><span style="color:#323232;">FILES
</span><span style="color:#323232;">     communities
</span><span style="color:#323232;">             Community database from lemmyverse.net.
</span><span style="color:#323232;">
</span><span style="color:#323232;">ENVIRONMENT
</span><span style="color:#323232;">     lemmyverse uses the following environment variables:
</span><span style="color:#323232;">
</span><span style="color:#323232;">     XDG_CACHE_DIR
</span><span style="color:#323232;">             The directory to store the community database.  If unset,
</span><span style="color:#323232;">             $HOME/.cache/lemmyverse is used.
</span><span style="color:#323232;">
</span><span style="color:#323232;">EXAMPLES
</span><span style="color:#323232;">     Find communities for the Plan 9 operating system:
</span><span style="color:#323232;">           lemmyverse '(plan9)|(Plan 9)'
</span><span style="color:#323232;">
</span><span style="color:#323232;">     List all communities from the instance lemmy.sdf.org:
</span><span style="color:#323232;">           lemmyverse '@lemmy.sdf.org'
</span><span style="color:#323232;">
</span><span style="color:#323232;">EXIT STATUS
</span><span style="color:#323232;">     The lemmyverse utility exits 0 on success, and >0 if an error occurs.
</span><span style="color:#323232;">
</span><span style="color:#323232;">SEE ALSO
</span><span style="color:#323232;">     grep(1), curl(1), https://lemmyverse.net
</span>
mrmanager ,
@mrmanager@lemmy.today avatar

Very nice tool, will use this for sure. I prefer command line also, so much faster.

garam ,
@garam@lemmy.my.id avatar

Thanks for sharing, and hello from Regional Indonesian/Bali instance!

otl OP ,
@otl@lemmy.sdf.org avatar

Selamat malam dan terimah kasih :) Nenak saya berasal dari Java, tetapi bahasa indonesia saya tidak bagus :( Saya belajar !

garam ,
@garam@lemmy.my.id avatar

Selamat malam!

Belajar saja, semua belajar. Inggris juga bukan bahasa Ibu saya. 😂

Saya sendiri tak bisa bahasa Ibu saya, hanya. Bisa bahasa Indonesia 😂🤪

Learn Javanese, it will be fun,

freamon ,

Lemmyverse is great - I use it to generate the lists at Trending Communities.

Re: the “thousands of spam/bot communities at lemmy.world?” question in your source, yeah there’s about 6k. A user tried to create about 2000, all called “serverhold” if you want a way to exclude them, got banned, and in retaliation created about 4000 with that junk string.
The admin of lemmyworld said it’ll take time to remove them, but I don’t know why (there seems to be the functionality in the API)

otl OP ,
@otl@lemmy.sdf.org avatar

Oh that’s interesting - nice spotting.

The admin of lemmyworld said it’ll take time to remove them, but I don’t know why (there seems to be the functionality in the API)

Indeed. Looks like it’s just a matter of a big for loop over each community ID, POST /community/delete with body community_id=1234. Maybe I’ll try to see if it’s possible to get some action on removing them by sending over some Python script or something that does the job. Quick count shows almost 14%(!) of all communities indexed by lemmyverse are those junk communities:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">% lemmyverse . | wc -l
</span><span style="color:#323232;">  30376
</span><span style="color:#323232;">% lemmyverse enoweiooe | wc -l
</span><span style="color:#323232;">   4206
</span>
mrmanager ,
@mrmanager@lemmy.today avatar

You can probably also delete them directly in the instance database with simple sql. Unless there are dependencies that will cascade delete things that are not wanted. :)

otl OP ,
@otl@lemmy.sdf.org avatar

Yeah that’s another way. I’m pretty terrible with relational databases, though! I’ve sent over a Python script which does the job via the HTTP API. Hopefully the admins of lemmy.world will see the post: lemmy.world/post/1720870

otl OP ,
@otl@lemmy.sdf.org avatar

Follow up: I wrote a script to delete all the communities made by that user. lemmy.world/post/1720870Feel free to upvote for visibility ;)

freamon ,

Will do. Hope they use it, having all that junk in the JSON file is no use to anyone.

zazaserty ,
@zazaserty@discuss.tchncs.de avatar

Thats a great command line utility!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines