πŸ—» James Van Dyne

✈️Trips πŸ—ΊοΈMaps ✏️️Blog πŸ”—οΈοΈLinks πŸƒRuns πŸ‘‰Now
  • 🏑Home
  • ✈️Trips
  • πŸ—ΊοΈMaps
  • ✏️Blog
  • πŸ”—οΈLinks
  • πŸƒRuns
  • πŸ‘‰Now
  • ✏️Articles
  • πŸ“€οΈReplies
  • πŸ’¬Status
  • πŸ”–οΈοΈBookmarks
  • πŸ—ΊCheckins
  • πŸ“…The Week
  • πŸ–₯Tech
  • 🌲Sustainability
  • πŸƒRunning
  • 🧠Thoughts
  • πŸ‡―πŸ‡΅Japan
  • πŸ’‘TIL
  • β›°Tanzawa
  • 🏑Home
  • ✏️Articles
  • πŸ“€οΈReplies
  • πŸ’¬Status
  • πŸ”–οΈοΈBookmarks
  • πŸ—ΊCheckins
  • πŸ“…The Week
  • πŸ–₯Tech
  • 🌲Sustainability
  • πŸƒRunning
  • 🧠Thoughts
  • πŸ‡―πŸ‡΅Japan
  • πŸ’‘TIL
  • β›°Tanzawa
  • Mar 22, 2021
    by James
    Getting the base models used for importing Wordpress posts into Tanzawa built has made the task feel a bit less daunting. There's a clear path forward.
    πŸ”—permalink
  • Checkin to Starbucks

    Starbucks 35.42861 139.506997
    Mar 21, 2021
    by James
    in Kanagawa, Japan
    Rainy cafe days.
    2021-04-21T00:05:31.jpg 448.74 KB
    πŸ”—permalink 5 interactions
  • Planning the Wordpress Migration

    Mar 21, 2021
    by James
    in Yokohama, Kanagawa Prefecture, Japan
    The next big challenge for Tanzawa, and the last thing required for me to switch to it, is import my data from my existing Wordpress blog. There's 4 major parts to this challange:

    1. Parsing the Wordpress export XML file
    2. Figuring out how to map Wordpress posts to Tanzawa posts
    3. Downloading and importing media
    4. Rewriting existing posts to use these new asset urls and fix links.

    The first step is the easiest. I've figured out the basics of it yesterday using Beautiful Soup, but will require more exploration of the various posts before I can decide how to properly map data.

    The other steps are managable, but wrapped up in a 5th challenge –  managing the entire import process itself. Initially I had planned on just making a command line import tool. Run the command and it does its best to import everything. But telling Tanzawa how to map categories to streams would entail complex command parameters, which I wouldn't want to use myself, let alone inflict on others.

    Rather, I need a simple web interface and database tables that will let me manage and monitor the process. The basic workflow I'm imagining is something like this:

    1. User uploads Wordpress export file -> Tanzawa saves it into a blob in its database along with some basic meta information about it.
    2. Tanzawa will create a mapping record for each category/post/post-kind found in the file. In step 2 users will see a list of their Wordpress categories with a dropdown next to each one with the stream it should map to (not mapping is also an option).
    3. Tanzawa will also provision a record for each photo and post to import. This will include its planned final permanent url, as wellΒ  its existing permanent url, and will be central when rewriting content.
    4. The photo records will track not only urls, but also file download status, so we don't download photos twice. There should be a page where users can see a list of all photos to import, the status, and perhaps a button to retry if it's failed.Β 

    One tricky bit will be that Tanzawa doesn't support background tasks. Which means I can either introduce them (don't really want to) or I need to find a way to control entirely by the front-end.Β  I think a little a small Stimulus controller on the photo list page that loops through each photo and call an import api should be sufficient.

    5.Β  Once the photos have been imported there should be a big button to publish all the changes. This will be button that will actually execute the entry creations.
    6. After importing is complete, all of the old Wordpress urls should automatically redirect to their new Tanzawa permalink.

    Throughout this process I'll likely find data that I (should) import that I don't have a way to handle in Tanzawa - and as such I may need to create features to handle them along the way.

    Thinking about how large of a task importing Wordpress properly is a bit daunting. But if I just make a little progress each day, piece by piece, I'll complete it before I know it.
    πŸ”—permalink
  • Weekly Roundup #2

    Mar 21, 2021
    by James
    This past week was spent rounding out support for checkins.

    Microformat Fixes


    I was so focused on getting locations functioning and out the door that forgot to include microformatted data. I've now included it along with the map and added tests to ensure I don't break it in the future.

    Checkins


    Building locations helped me figure out the best pattern for adding 1-to-1 related data to an entry. A checkin is a location and a checkin record which is the name of the venue and a url for the venue. The one limitationΒ  I built in surrounding checkins is that they must be created via a micropub request and can only be updated via the admin interface.

    While it's possible to integrate with Foursquare's places api and allow people to "checkin" using Tanzawa, it's a much better experience to use Swarm app and backfeed it.

    Syndications


    Syndications is different from locations or checkins because rather than being a 1-to1 relationship, they're a 1-to-Many relationship. i.e. a single entry can have multiple syndication urls.Β 

    Supporting multiple syndication urls from micropub is straight forward, I can just iterate over the urls and save. However, the adminΒ  interface allows me to add, update, and delete records. In addition to the form itself, it also requires a (hidden) management form to manage the number of records and so forth.Β 

    Thankfully I was able to work the pattern out so going forward, adding any other 1-toMany data for a post should be much quicker.
    πŸ”—permalink
  • Mar 20, 2021
    by James
    Parsing the Wordpress XML file with feedparser strips all of the Wordpress specific data. But it looks like I can use BeautifulSoup (which I'm using elsewhere) to get what I need. The "xml" parser preserves the CData, so I can get the encoded data, too. Progress.

    Example of getting content from Wordpress export files with Python
    πŸ”—permalink 1 interaction
  • Mar 20, 2021
    by James
    Shipped full support for checkins and syndication urls . Yay! πŸŽ‰ Next up is support for importing posts from Wordpress...😬
    πŸ”—permalink
  • Mar 19, 2021
    by James
    I got the web interface working for adding and removing of syndication urls. Nice and simple. Once I've got them marking up properly, I think they're ready to ship!

    Adding syndication urls in Tanzawa
    πŸ”—permalink
  • Response to inessential: New in NetNewsWire 6: Twitter Search Feeds

    Mar 18, 2021
    by James
    in Yokohama, Kanagawa Prefecture, Japan
    What’s cool about this: you can watch for mentions of whatever you want, and those come to you in the same app where your other feeds live.
    Following Twitter searches in NetNewsWire looks super handy. Will have to add the #IndieWeb hashtag once this is released.Β 
    πŸ”—permalink
  • Mar 18, 2021
    by James
    Back to building some base infrastructure again. This time for adding / deleting syndication urls. Deleting is simple enough – it's just a (hidden) checkbox with a small stimulus controller setup to toggle its label text between "Remove" and "Undo".

    Adding a secondary form also works. I output an empty formset form into my template then use a small action to copy it, replace the id and update the management form, 5 lines of code, half of which is variable definitions.

    My goal is to be able to reuse this whenever I need to add multiple related records to a post without any modifications.
    πŸ”—permalink
  • Response to Colin Walker - Mar 17, 2021

    Mar 17, 2021
    by James
    in Yokohama, Kanagawa Prefecture, Japan
    It's a little bittersweet β€” on the one hand it feels good as I know that I have a new solution but, on the other, it feels a little sad that the fruits of so much time and effort are now redundant.
    I feel this when I improve implementations all the time. Code reflects our best understanding of a given problem to a given solution at a given time. Requirements changing naturally means that the problem has also changed.

    When writing code I try to remind myself that all is temporary and will be deleted or rewritten at some point, so I best not grow too fond of it.
    πŸ”—permalink 1 interaction
Previous 151 of 360 Next
Reply by email
Powered by
πŸ”Tanzawa

← An IndieWeb Webring πŸ•ΈπŸ’β†’
Photo of James Van Dyne James Van Dyne Japan

Web developer living in Japan.