jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.52k stars 294 forks source link

XMPP: buku as a chat software (aka app) #719

Closed sjehuda closed 6 months ago

sjehuda commented 8 months ago

Greetings,

I have made an XMPP bookmark manager "bot" that uses buku to remotely handle bookmarks.

The client used to test Slixmark was Cheogram, which would be a better choice to manage bookmarks more than Termux, to some people.

This bot is in a testing phase, and is expected to be extended following the structure of Slixfeed (a news reader).

Known issues:

https://gitgud.io/sjehuda/slixmark

![zb2rhZvvTQDFbNWiwfQLQNRcNmbnuETAyS1GAKr5itQihTsKZ_b84c3f3ed62dccd5e39f073a1fc3baa19a990080](https://github.com/jarun/buku/assets/19249089/06032ace-23d6-431c-8032-be95bf936366) ![zb2rhn5rhCJEBTQieAkpBg6jHVAszvaht2gUE3xjUQDej4XbB_4f40bac8bf5a35c69e647949dea6cd34a97d4495](https://github.com/jarun/buku/assets/19249089/c28619ff-368d-44af-af6b-ec7e9e507ede) ![zb2rhYCCQTVweNCBmmYzRCjKoVmgoRzTbdkEdGieTfstYtxuM_c336d0562fc7edf692982cd7eb62ab6320b6400b](https://github.com/jarun/buku/assets/19249089/e2399712-7b44-4c5c-ba55-426966e9e1d8) ![zb2rhfv3QBRoCWcMXDPzCz3Hko2yvPSmUfmNJbeupA2Mk4eP5_afeb7061c58ab82b639d53438f5ed6fd6df74429](https://github.com/jarun/buku/assets/19249089/586fec40-4bb1-47ee-9e86-bc4045308beb) ![zb2rhdZYxDqqEiiY7cM3oatqiUSiMNi7UZ2KLfy1S2oyCMgSz_35006cd842e3f52a465ba4962befa9dc9539bdd5](https://github.com/jarun/buku/assets/19249089/797b404a-9efe-4fb9-90be-4edb04ed5bc1) ![zb2rhd3sM4FzhWBZTfvQt3aVupmV4YWcDV5cARHzupcUyWUHg_d91b1ca30d6b39ee36ff7368900f2a529f8adfcd](https://github.com/jarun/buku/assets/19249089/e7920385-5b68-4dfd-9a74-bf7b4ac02818) ![zb2rhd2M9kaFnGWENRUdRJbzbWe2YPucpwNdbEGWNDyrJkjEY_f808027e243e7abc41521a404f39edd11b23005e](https://github.com/jarun/buku/assets/19249089/c85fc9b4-f98d-44e7-876e-a3ff6bf06e03) ![zb2rhYnuCh9HHJZqNuDJHp8HTFwaRS8jxpbRKFRFTsbdUG31B_f1b43d4441ef26e238e9770ecdeab21c14fc99dc](https://github.com/jarun/buku/assets/19249089/eddf5014-f7f5-435a-82ec-9097dc07dd30)
jarun commented 8 months ago

Thanks for sharing! Are you looking for any help?

sjehuda commented 8 months ago

I think might, and I definitely would need feedback.

I intend to expand the code and make it modular like Slixfeed (aside from the core of it, because buku is the core).

I also want to make a "sharing" mechanism (del.icio.us style), by publicly exposing statistics of links by popularity, which could be displayed in a UI via ad-hoc commands.

It would be nice to bring this project, along with other projects that rely on buku, into buku itself, I suppose as /buku/xmpp or /buku/bots, once we have an account or organization by the name buku.

Generally, this bot works as expected, even though it was made in a couple of days or so.

jarun commented 8 months ago

@LeXofLeviafan any ideas?

LeXofLeviafan commented 8 months ago

I'm not exactly clear on the context (beyond the base "chat bot" premise) so my feedback would be rather limited; but there actually is a few things I can point out here.

LeXofLeviafan commented 8 months ago
Also, you can make collapsible sections in Markdown (at least on GitHub and probably other similar sites) like this, to avoid cluttering the thread ```md
Description goes here (no markdown if formatted like this) Markdown contents goes here. (Note the **empty line** after HTML.)
```
sjehuda commented 8 months ago

You can make collapsible sections in Markdown

Done. Thank you.

I'm not familiar with this del.icio.us site.

The website is a static archive, at the moment. This is what it once used to be https://web.archive.org/web/20081001225151/http://delicious.com/

If it involves giving external access of any sort to the user's private bookmarks, it absolutely has to be opt-in

Of course.

This is only an idea.

In any case, I would not be able to do so, unless I insert a new table to the buku database to manage links that may be shared, which would raise the need to import sqlite3, which would keep normal operation of buku intact, even without the bot.

Having a sharing mechanism in XMPP is far more preferable than in intrusive and harmful "apps".

Having a place to find buku-related projects would be good for users to discover them

Shall we open an organization at codeberg?

I believe using "buku" instead of "mark"

slixbuku? buku bot?

That repo could use a README file, and the screenshots would be helpful there.

I will do.

Speaking of the lack of README: I have no clue how this thing is meant to be used, infrastructure-wise. How is it supposed to be set up/installed?

1) This is a client bot. 2) Run it with python slixmark.py. 3) Input JID (XMPP account) and password. 4) Send it a message. 5) If you want to see UI (i.e. forms and buttons), use Cheogram.

Not sure about this "Browse" screenshot (it appears to be a settings page, in which case it should really be renamed 😅), but I see a distinct lack of a number showing the value of that slider (which means a user would have a hard time telling how many "results per page" were selected here)

This is only the start. More improvements are expected.

It appears that bookmark edit interface does not support updating URLs

This is correct. It can be editable. I suppose a confirmation form would be ideal.

Tag editing could use a lot of improvement

You are correct.

I was more worried for a sensible appearance.

It (probably) shouldn't be impossible to implement a row of buttons (tags) followed by a text field

I can add a list-multi form which would allow select and deselect, and below it, the text-single form. Thank you for rasing my attention.

And some sort of a suggestions list

The forms are static in most - if not all - XMPP clients.

I suppose this could be achieved, and this is dependant on XMPP clients.

sjehuda commented 8 months ago

This is not an issue. It belongs to discussions. Why did you post this here?

Because I wanted to:

1) Even better the morality of the awesome developer of buku who has made one of the most important software in the world - and he did! 2) Display a better way to make buku usable on Android devices (the current way proposed by the developer is Termux - a terminal emulator - for Android). 3) Hope to make slixmark (or bukubot) a part of the buku project, which is - as a homage - the reason I made that bot in one file, unlike Slixfeed.

LeXofLeviafan commented 8 months ago

insert a new table to the buku database

Maybe use a separate file instead? Deviating from expected DB structure may have negative consequences down the road. (…Though someplace to put additional params might appear at a later point.) Alternatively a flag could be introduced – the "immutable" thing is stored as a bitmask (despite containing a single value); though it has the same potential for long-term issues due to deviating from the "official" DB format.

Having a sharing mechanism in XMPP

Come to think of it, how would it be shared? You'd need to centralize it somewhere to get any sort of stats :thinking:

Shall we open an organization at codeberg?

Not sure if that would be the best approach in terms of discoverability… I've literally never heard of Codeberg before now :sweat_smile:

slixbuku? buku bot?

Perhaps something including XMPP in the name as well? "Bot" seems to be close to the purpose, but most would probably expect a Telegram bot or something from such a name :sweat_smile:

Run it with python slixmark.py.

Er… Run how, exactly? Via Termux? Based on the screenshots it appears that Android is the (primary?) target platform here. Or do XMPP clients have a dedicated way to run python scripts?

I suppose this could be achieved, and this is dependant on XMPP clients.

If your suggested client is Cheogram, it would be a good idea to see if you can come up with something that works for it, at the very least :thinking:

sjehuda commented 8 months ago

Maybe use a separate file instead?

Of course.

Come to think of it, how would it be shared? You'd need to centralize it somewhere to get any sort of stats

Via PubSub XEP-0060 or XEP-0472. Please see https://xmpp.org/extensions/xep-0472.html

Run how, exactly?

The UI seen in the screenshots is a realization of XEP-0004 (Data Forms) and XEP-0050 (Ad-Hoc Commands) which allow custom UI inside XMPP clients.

If your suggested client is Cheogram, it would be a good idea to see if you can come up with something that works for it, at the very least

I did not understand this last paragraph.

LeXofLeviafan commented 8 months ago

Suppose buku.io has an XMPP server.

Ah, so you effectively need a dedicated server for this script.

I did not understand this last paragraph.

…Not sure how to elaborate beyond what I said already. If implementation of a suggestions list is client-specific, and you have a specific preferred client, then it's a good idea to see if you can make it work in that specific client, at the very least.

sjehuda commented 8 months ago

On Mon, 11 Mar 2024 16:00:56 -0700 LeXofLeviafan @.***> wrote:

Suppose buku.io has an XMPP server.

Ah, so you effectively need a dedicated server for this script.

No. You can register two XMPP accounts, even on different servers.

Then use @. to connect the bot. And use your own account @. to speak to the @.***

There is no need to over complicate it and consequently interpret what I wrote.

1) Just make two account. 2) Use account A for bot. 3) Use Poezio or Gajim or Cheogram for you. 4) Done.

I did not understand this last paragraph.

…Not sure how to elaborate beyond what I said already. If implementation of a suggestions list is client-specific, and you have a specific preferred client, then it's a good idea to see if you can make it work in that specific client, at the very least.

The bot works with any XMPP clients.

The UI works with Converse.js, Movim, monocles (next version), Gajim (next version) and Cheogram.

Psi and Psi+ also support the UI.

LeXofLeviafan commented 8 months ago

2) Use account A for bot.

Use it how, specifically? By running a program that always stays online (which means you need a machine to be always running it) in order to handle requests sent by a user (via a specific kind of application)?

Well, there's a term for such programs: "server".

sjehuda commented 8 months ago

Please pardon me for the belated respond.


"server"

Yes, you are correct.

buku on Termux does not require connectivity, and Slixmark (or BukuBot) does require connectivity.

However, this server-type of software does not require port-forwarding or setting up special network settings, as some software do.

This bot requires an XMPP account, which means that there are more people of more types that can easily utilize it themselves, just by using an XMPP server of others, which is one of the main reasons I have chose XMPP as platform.


@jarun @LeXofLeviafan I intend to make the project to look similar to Slixfeed (i.e. separate it into modules).

I am not an expert, so I would be glad if you have any special instructions or recommendations for this, otherwise, please close this issue, and I will prepare a README file and ask to list this project in your README file.

sjehuda commented 6 months ago

I have updated the project and renamed the name of the package to "bukuxmpp".

It is installable with pip git+https://gitgud.io/sjehuda/slixmark.

The package has not been published on pypi yet.

This bot can serve several contacts at once, each contact has its own database file.

I encourage you to try it and if you do, then please do tell me what features you want to have.

Thank you.