-
byFeeling a bit tired today but not wanting to break the chain of progress, I managed to get just a little bit done today.
I implemented Stream RSS feeds. This allows readers to subscribe to just a specific stream, rather than the entire river. You could also use the stream feeds to selectively syndicate content elsewhere e.g. I want all my status and article posts to syndicate to micro.blog, but not my checkins. -
byWhen authoring a post you can now select which streams you'd like for them to appear in.Β As each stream can have different visibility settings we show them along with the stream in understandable terms.
Selecting streams with Tanzawa
Next up is adding feeds for each stream type and setting the stream on micropub requests. -
byI started work on implementing streams this morning. This is what it's looking like on the public side with the default streams. Feels nice to be working on user-facing features again.
Tanzawa with streams -
byNo coding today. Planning and thinking about how to implement Streams, one of my core ideas behind Tanzawa.
Streams will help you categorize and posts and blogs. You have a running stream, a status stream, a checkins steam. Each stream is independent of each other and each stream flows into the main Tanzawa stream.
Posts of any kind can appear in any stream. Streams will be listed on the left and have their own feed.Β In micropub parlance these would be tags or categories.Β
Some streams may be unlisted streams, entirely off the map, hiding all contents from anyone that isnβt logged in.Β
Once streams are working, I can start modeling checkin and address data requirements and add support to micropub.
βββ
The other thing Iβm starting to think about is how other people could start using Tanzawa. Initial setup a little involvedΒ as SQLite needs Geo extensions installed to work. A Docker container would be easiest to make it all work, but even thatβs a hurdle to getting started.Β
I could provide hosting, but Iβm not sure I want that kind of responsibility yet.Β One step at a time. -
byAfter confirming that the <html> tag inside the <figure> tag was causing the errors with Feedly I went and fixed all posts. Below is the script I ran in the django shell.
Happy to report that Tanzawa is once again producing valid rss.from bs4 import BeautifulSoup from post.models import TPost for t_post in TPost.objects.all(): entry = t_post.ref_t_entry.first() soup = BeautifulSoup(entry.e_content, 'html.parser') for html in soup.find_all('html'): try: pic = html.find('picture').extract() except AttributeError: # no pic continue html.replace_with(pic) entry.e_content = str(soup) entry.save()
Also being able to back up and restore your site's database with a simple "cp db.sqlite3 db.sqlite3.bak" is soooooooo nice. -
by
As of today, Tanzawa officially supports IndieAuth and Micropub. Micropub is still a work-in-progress, but it works for basic note and articles with photos. I also pushed the RSS fix so _new_ posts with images should display properly for Feedly users. By the way - this post was made with Quill. -
byFigured out (I think) the issue with my Feedly feeds and images. I use BeautifulSoup and Django templates to rewrite the image tags generated by Trix to be lazy loading and offer optimized formats on the backend.
picture = BeautifulSoup( render_to_string("trix/picture.html", context),"html5lib" )
The issue is that the the "html5lib" causes my <figure> tag to be wrapped in <html> and <body> tags. Browsers are smart enough to filter this out. But these other parsers are not.
Changing this line to use the "html.parser" prevents wrapping my template in html tags and should solve the issue.picture = BeautifulSoup( render_to_string("trix/picture.html", context), 'html.parser' )
-
byMade good progress on the embed based64 image -> file save in tanzawa -> content rewrite. Now working on my handling of json micropub requests.Β
This handler is a bit large. I can't wait for it to be working so I can refactor it down to something a bit more manageable. -
byThose that are familiar with micropub know that there's two ways to use the endpoint. One is as a regular json api and the other is a plain-old form submit endpoint. Almost all integrations these days are done with json apis, so the idea of support a form api seems antiquated at first.
But once you realize that any site can publish to your site, including file attachments(!), with a simple form on their website, it doesn't seem so antiquated after-all. It feels quite liberating. In fact, it may be my favorite part of micropub.
Currently regular json requests can create a post. And form requests with file attachments can also create a post. Tanzawa automatically inserts the photo into the post and does its exif stripping, lazy loading, and other image loading optimizations.
Testing with the Quill article interface - image attachments are sent in base64 encoded strings in the img tag. Extracting those images, saving them to disk, and rewriting the html will take me another day to complete.
---
Feedly is still mangling my posts. Besides the figure tag messing things up for feedly, another theory I have is that it doesn't like text content not wrapped in a <p> tag. Trix (the editor Tanzawa uses) wraps all content in a <div> tag and text is raw inside of it. I pushed an experiment to rewrite that <div> to a <p> tag in the RSS feed. Hopefully this fixes it.Mangled posts in Feedly -
byI've noticed some errors when Feedly parses my Tanzawa RSS feed. Namely that it doesn't show any content when I include an image. I have no idea why it's stripping all text from the posts.
Other fixes to the RSS feed include removing a / from the guid and setting the permalink to false, since the guid was not a url. As the guid change, most reads will show old posts as new - sorry about that.
This mostly a test post to see if adding titles for my statuses (the first 128 characters of plain text) will make Feedly parse properly when I include an image.
IfΒ this doesn't work, I have a theory that Feedly may not like <figure> tags, so I may try to rewrite my html content to be simpler for rss feeds.A photo of my new titles in NetNewsWire