Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sjehuda opened this issue Feb 29, 2024 · 14 comments
Closed

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

sjehuda opened this issue Feb 29, 2024 · 14 comments

Comments

@sjehuda
Copy link
Contributor

sjehuda commented Feb 29, 2024

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:

  • Ad-hoc: Search results do not reflect as expected.

https://gitgud.io/sjehuda/slixmark

zb2rhZvvTQDFbNWiwfQLQNRcNmbnuETAyS1GAKr5itQihTsKZ_b84c3f3ed62dccd5e39f073a1fc3baa19a990080
zb2rhn5rhCJEBTQieAkpBg6jHVAszvaht2gUE3xjUQDej4XbB_4f40bac8bf5a35c69e647949dea6cd34a97d4495
zb2rhYCCQTVweNCBmmYzRCjKoVmgoRzTbdkEdGieTfstYtxuM_c336d0562fc7edf692982cd7eb62ab6320b6400b
zb2rhfv3QBRoCWcMXDPzCz3Hko2yvPSmUfmNJbeupA2Mk4eP5_afeb7061c58ab82b639d53438f5ed6fd6df74429
zb2rhdZYxDqqEiiY7cM3oatqiUSiMNi7UZ2KLfy1S2oyCMgSz_35006cd842e3f52a465ba4962befa9dc9539bdd5
zb2rhd3sM4FzhWBZTfvQt3aVupmV4YWcDV5cARHzupcUyWUHg_d91b1ca30d6b39ee36ff7368900f2a529f8adfcd
zb2rhd2M9kaFnGWENRUdRJbzbWe2YPucpwNdbEGWNDyrJkjEY_f808027e243e7abc41521a404f39edd11b23005e
zb2rhYnuCh9HHJZqNuDJHp8HTFwaRS8jxpbRKFRFTsbdUG31B_f1b43d4441ef26e238e9770ecdeab21c14fc99dc

@jarun
Copy link
Owner

jarun commented Mar 5, 2024

Thanks for sharing! Are you looking for any help?

@sjehuda
Copy link
Contributor Author

sjehuda commented Mar 7, 2024

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
Copy link
Owner

jarun commented Mar 8, 2024

@LeXofLeviafan any ideas?

@LeXofLeviafan
Copy link
Collaborator

LeXofLeviafan commented Mar 9, 2024

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.

  • No opinion on project structure (it's your own pet project so it's up to you really); buku itself is crammed into a single file (which I'm guessing is so that it could be used as a standalone script without any installation), but such an approach certainly has its downsides.

  • I'm not familiar with this del.icio.us site (it appears to require registering before looking at anything so I'm not exactly eager to try either), and with no context I'm not really sure how this "sharing" is supposed to work; that being said, if it involves giving external access of any sort to the user's private bookmarks, it absolutely has to be opt-in.

  • Having a place to find buku-related projects would be good for users to discover them, at the very least (and I did have an idea of a buku-based app as well); but there's a little problem here: GitHub already has an organization named "buku" (…which contains a single empty repo created 10 years ago 😅)

  • I believe using "buku" instead of "mark" in the name could potentially make the connection with the backend less confusing/more explicit for a new observer.

  • That repo could use a README file, and the screenshots would be helpful there (albeit scaled down to half their size so that they actually fit on a regular laptop screen, I'd say; it's kinda hard to make heads or tails of it otherwise… also combining them into rows of like 4x images would make it easier to browse a long list of such screenshots).

    • 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? Is it a plugin that works on a local file? Is it a script for a remote server that the user has to set up? Or does it run on a server that multiple users log in to (and supposedly handles multiple DBs at once securely)?
  • 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)

  • It appears that bookmark edit interface does not support updating URLs… Buku does support it though, and there's certainly cases when a bookmark URL needs to be updated. (Also, can this URL be copied into the clipboard?)

    • Tag editing could use a lot of improvement… compare with bukuserver (WebUI):
      image
      It doesn't have to be identical, so it (probably) shouldn't be impossible to implement a row of buttons (tags) followed by a text field and some sort of a suggestions list (unless you are severely limited in terms of what UI you can show, anyway).

@LeXofLeviafan
Copy link
Collaborator

LeXofLeviafan commented Mar 9, 2024

Also, you can make collapsible sections in Markdown (at least on GitHub and probably other similar sites) like this, to avoid cluttering the thread
<details><summary>Description goes here (no markdown if formatted like this)</summary>

Markdown contents goes here. (Note the **empty line** after HTML.)
</details>

@sjehuda
Copy link
Contributor Author

sjehuda commented Mar 9, 2024

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.
  • Psi is also supported.
  • Gajim and monocles chat will be supported in the very next version.

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
Copy link
Contributor Author

sjehuda commented Mar 9, 2024

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.
  • If you would not want this as a part of this project, I will continue to work on it at GitGud and hope to get your involvement.

@LeXofLeviafan
Copy link
Collaborator

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 🤔

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 😅

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 😅

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 🤔

@sjehuda
Copy link
Contributor Author

sjehuda commented Mar 11, 2024

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.

  • Suppose buku.io has an XMPP server.
  • Start slixmark.py with JID (e.g. bot@buku.io) and Password.
  • Then, you (lex@buku.io) communicate with the JID the bot is connected with.
  • If you want to see the UI (buttons and text-fields), use Cheogram.

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
Copy link
Collaborator

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
Copy link
Contributor Author

sjehuda commented Mar 12, 2024 via email

@LeXofLeviafan
Copy link
Collaborator

  1. 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
Copy link
Contributor Author

sjehuda commented Mar 17, 2024

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
Copy link
Contributor Author

sjehuda commented Apr 23, 2024

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants