GNU social Conversation Assembler Thing
This tool tries to assemble complete GNU social conversation trees from the URL of a single notice in the conversation. This is a no-frills utility at the moment, and you can't reply from here, but at least you'll be able to read the conversation without hopping from node to node. It mostly works!
**WARNING** I use some synchronous HTTP requests in this, which can make your browser unresponsive while waiting for slower nodes to return data. And some nodes are really slow. Like... tens of seconds slow. Soon, I'll fix that section of the code.
- Conversations will not update after you've viewed them once. It's not a problem with this script, it's a problem with the CORS proxy I'm using (currently crossorigin.me) which caches requests for 24 hours or some other damnably-long time. If you're experiencing this and you have a different CORS proxy to use, enter its address here and try again:
- Posts from Friendica users are sometimes dead-ends as all Friendica instances seem to require authentication for API access. Furthermore...
- Posts from Ostatus-federated services other than GNU social can cause ... unexpected results.
(email@example.com) on GS
From This Page
Since you're already here: paste or type the permalink URL (ex. "
https://gnusocial.server/notice/54321") of any post into the search box atop this page, and hit — or just press ⏎.
From Your Browser's Address Bar
Probably the easiest way, if you're going to use this tool with any regularity, is to install it as a search engine in your browser.
- Right-click in the search box, and select "Add a Keyword for this Search..."
- Change the name to whatever you want and give it a short keyword, like "gs".
- Open your Settings page, look under the Search category and click the Manage Search Engines... button.
- Add a new search engine at the bottom. The name can be whatever, the keyword can be something short, like "gs", and use this as the URL:
After you've done either of those, all you'll need to do is type "gs " (or whatever keyword you used) in your browser's address bar, and then type or paste a note's permalink and hit Enter.
How It Works
The extremely-short version:
- Look at a post's JSON representation to find the conversation ID on its server.
- Load the conversation's JSON Activity Streams representation and start making a collection of posts.
- Go through the posts and see if any of them are from other servers. If they are, go back to step 1 for a post from each of the different servers.
- Throw away duplicate posts we've collected from all the servers.
- Sort 'em by date.
- Render 'em as HTML
- Stick replies inside the container DIV of the note they reply to.
- Shoot lasers out of your ears!
This needs work. The JSON Activity Streams representation of conversations is missing some useful data in the activity objects. I'll probably change this to use the Atom representation in the future, which is a bit more complete.
G5M.1337 - Added a quick hack for "folding" the replies of messages.
G2S.1426 — Fixed another dumb error that caused some conversation fetches to loop out of control.
G2J.0197 — Fixed a pretty dumb error that caused the conversation to appear twice.
G2F.0197 — A little code cleanup, and some style changes. Image attachments show now - other attachments soon!
G2D.0203 — Page is now accessible at http://laemeur.sdf.org/gs/convo, and notice permalinks can be passed as query strings (see "TO USE:" above).
G2C.1430 — Long conversations are fixed. I'd forgotten to take into account that the JSON API only returns conversation items 20-per-page.