diff --git a/README.md b/README.md index 2a976dd..253d5b1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ types adc, dweb, ed2k, feed, ftp, gemini, geo, gopher, http, ipfs, irc, magnet, mailto, monero, mms, news, sip, udp, xmpp and any scheme and type that you desire. -# Technicalities +## Technicalities Blasta is a federated bookmarking system which is based on XMPP and stores bookmarks on your own XMPP account; to achieve this task, Blasta utilizes the @@ -48,8 +48,9 @@ The connection to the Blasta system is made with XMPP accounts. - Atom Syndication Format; - Federation; - Filters; -- Pin directory; -- Publish-Subscribe. +- Pin; +- Publish-Subscribe; +- Report. ## Requirements @@ -67,7 +68,7 @@ Use the following commands to start Blasta. ```shell $ git clone https://git.xmpp-it.net/sch/Blasta $ cd Blasta/ -python -m uvicorn blasta:app --reload +$ python -m uvicorn blasta:app --reload ``` Open URL http://localhost:8000/ and connect with your Jabber ID. diff --git a/blasta.py b/blasta.py index ac03331..012f700 100644 --- a/blasta.py +++ b/blasta.py @@ -751,6 +751,10 @@ class HttpInstance: # It does not seem to actually filter tags. # NOTE Yes. It does work. # See function "cache_items_and_tags". + + # TODO Search by query + #if param_query: + if param_tags or param_tld or param_filetype or param_protocol: tags_list = param_tags.split('+') if len(tags_list) == 1: @@ -1834,15 +1838,16 @@ class HttpInstance: exist = True break else: - print('IQ ISSUE?') - breakpoint() - print('IQ ISSUE?') - + message = 'XMPP system message » Error: {}.'.format(iq) + description = 'The requested bookmark could not be retrieved' + path = 'error' + return result_post(request, jabber_id, description, message, path) if exist: # TODO Perhaps adding a paragraph with "your tags" and "who else has tagged this link" # and keep the (5 item) limit. - #entry = Syndication.extract_items(item_payload, limit=True) - entry = Syndication.extract_items(item_payload) + #entry = Syndication.extract_items(item_payload) + # NOTE Display only 5 items, as all the other tags appear at the list of "Related tags". + entry = Syndication.extract_items(item_payload, limit=True) if entry: #url_hash = iq_item['id'] url_hash = Utilities.hash_url_to_md5(entry['link']) @@ -1854,11 +1859,12 @@ class HttpInstance: entry['name'] = name entry['url_hash'] = url_hash entry['published_mod'] = Utilities.convert_iso8601_to_readable(entry['published']) + #entry['tags'] = entry['tags'][:5] entries.append(entry) tags_list = {} tags_and_instances = SQLite.get_tags_and_instances_by_url_hash(db_file, url_hash) for tag, instances in tags_and_instances: tags_list[tag] = instances - else: + else: # NOTE Is it possible to activate this else statement? Consider removal. # https://fastapi.tiangolo.com/tutorial/handling-errors/ #raise HTTPException(status_code=404, detail="Item not found") message = 'Blasta system message » Error: Not found.' @@ -1930,7 +1936,6 @@ class HttpInstance: description = 'The requested bookmark does not exist' path = 'error' return result_post(request, jabber_id, description, message, path) - return response message = 'Information for URL {}'.format(entries[0]['link']) # entry[2] description = 'Discover new links and see who shares them' template_file = 'browse.xhtml' @@ -1977,12 +1982,13 @@ class HttpInstance: db_file = 'main.sqlite' instances = SQLite.get_entry_instances_by_url_hash(db_file, url_hash) timestamp = datetime.now().isoformat() + tags_new = Data.organize_tags(tags) if tags else '' entry = {'title' : title.strip(), 'link' : url.strip(), 'summary' : summary.strip() if summary else '', 'published' : published, 'updated' : timestamp, - 'tags' : Data.organize_tags(tags) if tags else '', + 'tags' : tags_new, 'url_hash' : url_hash, 'jid' : jabber_id, 'name' : name, @@ -2051,18 +2057,22 @@ class HttpInstance: if node == 'public': tags_valid = [] tags_invalid = [] - tags_list = tags.split(',') - tags_old_list = tags_old.split(',') - for tag in tags_old_list: - if tag not in tags_list: + #tags_list_new = tags.split(',') + tags_list_new = tags_new + tags_list_old = tags_old.split(',') + for tag in tags_list_old: + if tag not in tags_list_new: tags_invalid.append(tag) - for tag in tags_list: - if tag not in tags_old_list: + for tag in tags_list_new: + if tag not in tags_list_old: tags_valid.append(tag) + # FIXME Variable tags_valid is not in use. + # NOTE Variable tags_valid might not be needed. See function associate_entries_tags_jids. await SQLite.delete_combination_row_by_entry_id_and_tag_id_and_jid_id(db_file, url_hash, tags_invalid, jabber_id) await SQLite.add_tags(db_file, [entry]) # Slow (high I/O) - if not SQLite.get_entry_id_by_url_hash(db_file, url_hash): + entry_id = SQLite.get_entry_id_by_url_hash(db_file, url_hash) + if not entry_id: await SQLite.add_new_entries(db_file, [entry]) # Is this line needed? await SQLite.associate_entries_tags_jids(db_file, entry) #elif not SQLite.is_jid_associated_with_url_hash(db_file, jabber_id, url_hash): @@ -2072,12 +2082,14 @@ class HttpInstance: # Entry for HTML entry['published_mod'] = Utilities.convert_iso8601_to_readable(published) entry['updated_mod'] = Utilities.convert_iso8601_to_readable(timestamp) + entry['tags'] = entry['tags'][:5] entries = [entry] template_file = 'browse.xhtml' template_dict = { 'request': request, 'description': description, 'entries': entries, + 'exist': True, 'jabber_id': jabber_id, 'journal': journal, 'message': message, @@ -2085,7 +2097,8 @@ class HttpInstance: 'param_hash': param_hash, 'path': path, 'pubsub_jid': jabber_id_pubsub, - 'syndicate': syndicate} + 'syndicate': syndicate, + 'tags' : tags_new} response = templates.TemplateResponse(template_file, template_dict) response.headers["Content-Type"] = "application/xhtml+xml" return response @@ -4556,6 +4569,10 @@ class SQLite: cur = conn.cursor() cur.execute(sql, par) + # NOTE The result was ordered by number of instances + # ORDER BY main_tags.instances DESC + # And has been changed to order of alphabet + # ORDER BY main_tags.tag ASC def get_tags_by_entry_id(db_file, entry_id): """ Get tags by an ID entry. @@ -4577,11 +4594,11 @@ class SQLite: # .format(function_name, db_file, index_first)) sql = ( """ - SELECT main_tags.tag + SELECT DISTINCT main_tags.tag FROM main_tags INNER JOIN combination_entries_tags_jids ON main_tags.id = combination_entries_tags_jids.tag_id WHERE combination_entries_tags_jids.entry_id = ? - ORDER BY main_tags.instances DESC + ORDER BY main_tags.tag ASC LIMIT 5; """ ) diff --git a/stylesheet/stylesheet.css b/stylesheet/stylesheet.css index 5bdb553..f66c9a4 100644 --- a/stylesheet/stylesheet.css +++ b/stylesheet/stylesheet.css @@ -147,7 +147,19 @@ form > * { width: 15%; /* float: right; */ /* width: 200px; */ +} + +#related-tags dd { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +#related-tags dd:hover { + overflow: unset; overflow-wrap: break-word; + text-overflow: unset; + white-space: unset; } #content { diff --git a/xhtml/about.xhtml b/xhtml/about.xhtml index fbbfbbd..4c27890 100644 --- a/xhtml/about.xhtml +++ b/xhtml/about.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / about diff --git a/xhtml/ask.xhtml b/xhtml/ask.xhtml index a9b8301..aca16be 100644 --- a/xhtml/ask.xhtml +++ b/xhtml/ask.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / {{path}} diff --git a/xhtml/atomsub.xhtml b/xhtml/atomsub.xhtml index 4f73b83..66a47bd 100644 --- a/xhtml/atomsub.xhtml +++ b/xhtml/atomsub.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / atomsub @@ -53,8 +53,12 @@

  PubSub Bookmarks

-

» The master standard for HTML.

-

Atomsub

+

+ » The master standard for HTML. +

+

+ Atomsub +

Atomsub, or Atom Over XMPP, is a simple and yet ingenious idea which was realized by the gentlemen: Peter Saint-Andre; @@ -82,7 +86,9 @@

datatracker.ietf.org - (PDF) + + ​  + (PDF)

  • @@ -134,6 +140,7 @@ xmpp.org + ​  libervia.org @@ -153,6 +160,7 @@ xmpp.org + ​  movim.eu diff --git a/xhtml/browse.xhtml b/xhtml/browse.xhtml index 3dd4920..649634d 100644 --- a/xhtml/browse.xhtml +++ b/xhtml/browse.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / {{path}} {{tag}} + ​  {% endfor %} {% endif %} by @@ -166,6 +167,7 @@ details {% endif %} + ​  at @@ -186,7 +188,10 @@ {{tag}} - ({{tags[tag]}}) + ​  + {% if tags[tag] %} + ({{tags[tag]}}) + {% endif %} {% endfor %}
    @@ -215,17 +220,19 @@ {% endif %}

    + 💡 - PubSub + ​  and + ⚛ - RSS - feeds for this page are available. + ​  + syndication feeds for this page are available.

  • -

    Features

    +

    + Features +

    -

    Interfaces

    +

    + Interfaces +

    @@ -263,46 +276,57 @@ Libervia is a Libre software, based on well established standards (XMPP), decentralised and federating. It is developed around strong ethical values. Check our - social - contract. + + social contract + + ​ + .

    -

    Press

    +

    + Press +

    @@ -314,12 +338,14 @@ Official Site + ​  (libervia.org)
  • Official Group Chat + ​  (chat.jabberfr.org)
  • diff --git a/xhtml/movim.xhtml b/xhtml/movim.xhtml index 381ea38..171fe56 100644 --- a/xhtml/movim.xhtml +++ b/xhtml/movim.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / movim @@ -56,7 +56,9 @@

    » The social platform shaped for your community.

    -

    About Movim

    +

    + About Movim +

    Movim is an abbreviation of "My Open Virtual Identity Manager" and is a distributed social network which, just @@ -91,7 +93,9 @@ The framework, which is built upon PHP, is a free software and can be experimented with by external developers.

    -

    What is Movim?

    +

    + What is Movim? +

    Movim is a social and chat platform that acts as a frontend for the XMPP network. @@ -107,7 +111,9 @@ Movim is fully compatible with the most used XMPP servers such as ejabberd or Prosody.

    -

    Blogs & Communities

    +

    + Blogs & Communities +

    Movim simplifies the management of your publications and news articles. So forget the ads, forget the superfluous. We @@ -118,7 +124,9 @@ nodes on different topics. Just click on the Communities link in your menu and start exploring!

    -

    Chats & Chatrooms

    +

    + Chats & Chatrooms +

    Start a conversation with a friend or join a multi-user chatroom in one click. @@ -127,34 +135,45 @@ Movim chats are coming with many features to give you the best chat experience across all your devices

    -

    Let's get started!

    +

    + Let's get started! +

    - Create an XMPP account + Create an XMPP account + + ​  and join one of our public instances on - join.movim.eu + join.movim.eu + + ​  (If you already have a XMPP account, you can directly join).

    -

    Press

    +

    + Press +

    @@ -166,12 +185,14 @@ Official Site + ​  (movim.eu)
  • Official Group Chat + ​  (conference.movim.eu)
  • diff --git a/xhtml/now.xhtml b/xhtml/now.xhtml index 97b7647..b0fdeb8 100644 --- a/xhtml/now.xhtml +++ b/xhtml/now.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / now diff --git a/xhtml/philosophy.xhtml b/xhtml/philosophy.xhtml index 114c57c..7c0146c 100644 --- a/xhtml/philosophy.xhtml +++ b/xhtml/philosophy.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / philosophy diff --git a/xhtml/profile.xhtml b/xhtml/profile.xhtml index 439e935..0e47604 100644 --- a/xhtml/profile.xhtml +++ b/xhtml/profile.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / profile diff --git a/xhtml/projects.xhtml b/xhtml/projects.xhtml index 5a8e201..50d0cc0 100644 --- a/xhtml/projects.xhtml +++ b/xhtml/projects.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / projects diff --git a/xhtml/pubsub.xhtml b/xhtml/pubsub.xhtml index 79439ca..b458e8f 100644 --- a/xhtml/pubsub.xhtml +++ b/xhtml/pubsub.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / pubsub @@ -183,18 +183,22 @@ brand:the-pirate-bay + ​  directory:torrent + ​  service:search + ​  by Fionn - ... + … and 57,293 other people + ​  at {{date_now_readable}}
    @@ -205,6 +209,23 @@ node urn:xmpp:bibliography:0 of your XMPP account.

    +

    Resources

    +

    diff --git a/xhtml/questions.xhtml b/xhtml/questions.xhtml index 9c397df..b7abc01 100644 --- a/xhtml/questions.xhtml +++ b/xhtml/questions.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / questions @@ -53,13 +53,19 @@

      PubSub Bookmarks

    -

    » Queries about Blasta.

    -

    Questions

    +

    + » Queries about Blasta. +

    +

    + Questions +

    This document enumerates questions that were referred to the project Blasta.

    -

    What is JID and what does it mean?

    +

    + What is JID and what does it mean? +

    JID is an abbreviation of Jabber ID.

    @@ -87,7 +93,9 @@ is related to computer language rust be tagged with "code:rust".

    -

    Why did you create Blasta?

    +

    + Why did you create Blasta? +

    We have created Blasta out of necessity.

    @@ -112,7 +120,9 @@ Hence, we have created Blasta, which is a combination of YaCy and Shaarli, and is built on top of XMPP.

    -

    Why do you provide Blasta for free?

    +

    + Why do you provide Blasta for free? +

    While we want to make profit, and feed our wives and children, we are aware that we must be providing the Blasta @@ -127,14 +137,16 @@ later becomes clandestinely subdued to thugs from government or intelligence, which is the worst of all circumstances.

    -

    What is your perspective?

    +

    + What is your perspective? +

    Our perspective is that people should be living for the sake of eternity, which is what we are doing by creating and distributing Blasta.

    - As conveyed in verse 77 of Hávamál: + As conveyed in verse 77 of Hávamál

    “Kinsmen die, and cattle die and so must one die oneself; @@ -146,11 +158,11 @@ ― Hávamál: Sayings of the High One

    - The German philosopher Arthur Schopenhauer has expressed - since the same idea when he said: + The German philosopher Arthur Schopenhauer expressed + essentially the same idea when he said, that

    - “The most any man can hope for: + “The very most any man can hope for:
    Is a heroic passage through life.”
    @@ -162,18 +174,24 @@

    Greatness, rather than happiness, is - a mark of a good life. + the mark of a good life + + ​ + .

    Live for the sake of eternity, for the past, and towards the future.

    -

    Why did you choose XMPP as a platform?

    +

    + Why did you choose XMPP as a platform? +

    - The XMPP platform (which is also known as Jabber), is a - reputable and a strong telecommunication platform which - almost every intelligence and militant agency on the world - is making use of as a premier telecommunication mean. + The XMPP platform (which is + also known as Jabber), is a reputable and a strong + telecommunication platform which almost every intelligence + and militant agency on the world is making use of as a + premier telecommunication mean.

    Because we did not want to use databases, which sometimes @@ -191,7 +209,8 @@ needed.

    - So we chose the specification XEP-0060: Publish-Subscribe + So we chose the specification XEP-0060: + Publish-Subscribe (PubSub) as a base mechanism for a data storage platform.

    @@ -201,25 +220,31 @@ truely private and is truely owned by the account owner, which is also a major advantage to Blasta, not only for the sake of privacy and data integrity, but also for an - immediate recoverying of the bookmarks sharing system, if - the Blasta database would be to diappear or should be - restructured. + immediate recovery of the bookmarks sharing system, if the + Blasta database would be to diappear or should be + restructured anew.

    -

    Use XMPP. Spread XMPP. Be XMPP.

    -

    What platform would you choose if not XMPP?

    +

    + Use XMPP. Spread XMPP. Be XMPP. +

    +

    + What platform would you choose if not XMPP? +

    If we were to choose another platfom, it probably would have been DeltaChat (SMTP and IMAP), Nostr or Session.

    -

    Why did you decide to make Blasta open source?

    +

    + Why did you decide to make Blasta open source? +

    One of the main reasons is for freedom to thrive.

    - We are worried due to various of PsyOps that are conducted - by governments, military and intelligence agencies, and we - realize that most of their success relies on the - centralization of information hubs; and + We are worried due to various of PsyOps that are being + conducted by governments, military and intelligence + agencies, and we realize that most of their success relies + on the centralization of information hubs; and

    We are further worried of the awful measures that are being @@ -276,7 +301,9 @@ functionality with userscripts and userstyles.

    -

    Conclusion

    +

    + Conclusion +

    Please contact us and ask us anything. We will be happy to read from you! diff --git a/xhtml/register.xhtml b/xhtml/register.xhtml index 06fd722..02e2a71 100644 --- a/xhtml/register.xhtml +++ b/xhtml/register.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / register diff --git a/xhtml/result.xhtml b/xhtml/result.xhtml index 1afa598..f36a3bf 100644 --- a/xhtml/result.xhtml +++ b/xhtml/result.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / {{path}} @@ -60,7 +60,7 @@ {{description}}

    - You can return to the previous page or browse + You can try to reload this page or browse {% if jabber_id %} your bookmarks. {% else %} diff --git a/xhtml/search.xhtml b/xhtml/search.xhtml index 83e7f1e..f97da89 100644 --- a/xhtml/search.xhtml +++ b/xhtml/search.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / search diff --git a/xhtml/software.xhtml b/xhtml/software.xhtml index e924a7a..effdb33 100644 --- a/xhtml/software.xhtml +++ b/xhtml/software.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / software diff --git a/xhtml/syndication.xhtml b/xhtml/syndication.xhtml index c8374b3..d37a8f2 100644 --- a/xhtml/syndication.xhtml +++ b/xhtml/syndication.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / syndication @@ -67,16 +67,23 @@ pages that list bookmarks.

    - An atom or an orange - - icon at the bottom of a subject page would indicate of + An atom or an orange icon ( + ⚛ + ) at the bottom of a subject page would indicate of availability of an Atom Syndication Feed for use with Feed Reader.

    - A bulb 💡 or an XMPP - - icon at the bottom of a subject page would indicate of + A bulb or an XMPP icon ( + 💡 + ) at the bottom of a subject page would indicate of availability of a PubSub subscription for use with an XMPP client.

    diff --git a/xhtml/tag.xhtml b/xhtml/tag.xhtml index bd2d1a5..67adf39 100644 --- a/xhtml/tag.xhtml +++ b/xhtml/tag.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / tag @@ -68,9 +68,11 @@ {% else %} {% endif %} - - {{tag}} - + + {{tag}} + + + ​  {% endfor %}

    diff --git a/xhtml/thanks.xhtml b/xhtml/thanks.xhtml index f8dc388..b86f8c9 100644 --- a/xhtml/thanks.xhtml +++ b/xhtml/thanks.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / thanks @@ -56,45 +56,59 @@

    » Gratitude and appreciation from the world over.

    -

    Thanks

    +

    + Thanks +

    We would want to express our gratitude and appreciation to special men and women from Argentina, Canada, France Germany, Ireland, Italy, Palestine, Russia and The Netherlands.

    -

    Mr. Damian Sartori

    +

    + Mr. Damian Sartori +

    We would want to thank to Mr. Damian Sartori (a.k.a.: TheCoffeMaker) from Cyberdelia for providing instructions for present and future database management.

    -

    Mr. Guus der Kinderen

    +

    + Mr. Guus der Kinderen +

    We would want to thank to Mr. Guus der Kinderen of Ignite Realtime who - has instantly provided us with relevant references from + has instantly provided us with relevant references from the + XMPP specification XEP-0060: Publish-Subscribe and who has generously provided us with Goodbytes - Openfire servers for testing Blasta and related projects. + + Openfire servers for testing Blasta.

    -

    Mr. Jérôme Poisson

    +

    + Mr. Jérôme Poisson +

    We would want to thank to Mr. Jérôme Poisson of project Libervia who has instructed us in coordinating the Blasta system with the Libervia system.

    -

    Mrs. Laura Lapina

    +

    + Mrs. Laura Lapina +

    We would want to thank to Mrs. Laura Lapina of 404 City and Loqi who has contributed her advises to select the proper technologies, and plan and engineer the master database operation workflow.

    -

    Mr. Schimon Jehudah Zachary

    +

    + Mr. Schimon Jehudah Zachary +

    We would want to thank to Mr. Schimon Jehudah Zachary of project @@ -104,22 +118,28 @@ information, including elaborative SQLite queries that have accelerated and saved us precious development time.

    -

    Mr. Simone Canaletti

    +

    + Mr. Simone Canaletti +

    We would want to thank to Mr. Simone Canaletti of project WPN who has helped - in deploying and testing our applications, including - benchmarking for mass deployment, in addition to providing - us with the adequate means for hosting the development - ground of the Blasta platform and related projects. + in deploying and testing Blasta, including benchmarking for + mass deployment, in addition to providing us with the + adequate means for hosting the development ground of the + Blasta platform and related projects.

    -

    Mr. Stephen Paul Weber

    +

    + Mr. Stephen Paul Weber +

    We would want to thank to Mr. Stephen Paul Weber of project Soprani.ca who has explained to us about various of the XMPP specifications.

    -

    Mr. Timothée Jaussoin

    +

    + Mr. Timothée Jaussoin +

    We would want to thank to Mr. Timothée Jaussoin of project Movim who has contributed @@ -130,7 +150,9 @@ various of occasions, including answering to questions that were already asked and answered more than once.

    -

    XMPP Berlin in association with XMPP Italia

    +

    + XMPP Berlin in association with XMPP Italia +

    Finally, we would want to thank to the fine gentlemen Lorenzo, Mario, Martin, Roberto, Schimon, Simone, and others @@ -143,7 +165,9 @@

    - XMPP-IT + + XMPP-IT +


    diff --git a/xhtml/utilities.xhtml b/xhtml/utilities.xhtml index ded36ab..5630f6f 100644 --- a/xhtml/utilities.xhtml +++ b/xhtml/utilities.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / utilities diff --git a/xhtml/xmpp.xhtml b/xhtml/xmpp.xhtml index b853716..2f56cc6 100644 --- a/xhtml/xmpp.xhtml +++ b/xhtml/xmpp.xhtml @@ -5,7 +5,7 @@ - Blasta + Blasta / xmpp