• The Week #32


    • Last week I had forgotten an interesting tidbit about my self-introduction presentation at work. During my presentation I introduced some of the apps I'd built for the Mac – ImageXY and Jisho. ImageXY was popular in Japan for its first couple of years and one of my co-workers actually used to use it all the time! First time I’ve met a random user of ImageXY!

    • The covid vaccine was finally approved in Japan and they're starting to vaccinate doctors and nurses this week. Still no idea when I'll be able to get my prick, but I imagine it will be sometime this summer. Speaking of getting the shot, I found out my grandma got her second covid vaccine shot last Wednesday. Woohoo!

    • I had my annual health check this week. As nobody is going in to the office, we are free to do our health check anywhere. I went to a a clinic In Minatomirai, as it was the closest to my house. The clinic itself was the top two floors of a high rise. We carried a little rfid card at each station and see a nurse/tech for the test, and finally a doctor briefly at the end to cover the results. Hope I can use this place next year too.

    • There was a large earthquake off the cost of Fukushima. It was about a 4 where I live in Yokohama, certainly the strongest and longest quake I've felt in a while. It reminded me of 3/11 in someways as just when you think it was going to stop it just kept getting stronger. I was fast asleep when it started, but you can see my heart rate from my Apple Watch about when it hit.

    • This week Leo turned 3. He has his official "chocolate debut" as he picked out a chocolate cake decorated like a panda. He must not have been impressed with the hype around chocolate as he only ate 2 bites.

    • I watched this good documentary called Winter in Stockholm. I hadn't realized how much I miss watching documentaries like these randomly on TV.

  • No 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.
  • Checkin to Soup Stock Tokyo

    in Yokohama, Kanagawa, Japan

    Post health check meal.



  • After 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.
  • 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.
  • Figured 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'
    )
  • Made 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.
  • Checkin to Châteraisé (シャトレーゼ 戸塚踊場店)

    in Yokohama, Kanagawa, Japan

    Birthday cake. 🎂

  • Those 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
  • 🔗 A Teenager Has Remade Myspace and Everyone Is Loving It

    Coded entirely by 18-year-old An, 'SpaceHey' harnesses nostalgia and a distaste for modern social media to bring the Old Internet back from the dead.
    Happy to see SpaceHey getting more users. I don't use it, but the world needs more social places online where you aren't you're free to customize it to your heart's content.
    1. Tagged with
    2. nostalgia
    3. computing
    4. social media
Previous 164 of 366 Next