πŸ—» James Van Dyne

✈️Trips πŸ—ΊοΈMaps ✏️️Blog πŸ”—οΈοΈLinks πŸ‘‰Now πŸƒRuns
  • 🏑Home
  • ✈️Trips
  • πŸ—ΊοΈMaps
  • ✏️Blog
  • πŸ”—οΈLinks
  • πŸ‘‰Now
  • πŸƒRuns
  • ✏️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 26, 2021
    by James
    Managed to get the category to stream and post kindΒ  to (tanzawa) post kind mappings working. I also got the attachment import records saving properly.Β 

    My basic plan for importing attachments is as follows. Each photo in Wordpress is exported as a post with the post type as "attachment". The guid for the item is the url for the attached file. So, I've created a record has a foreign key to the originating wordpress import record, the post guid, my own uuid, and a nullable foreign key to the resulting Tanzawa file attachment.Β 

    Once the file has been imported, I'll have a Tanzawa file attachment set so I'll easily be able to pick up where I left off.Β 

    Also since I'm keeping the originally uploaded Wordpress export file around and references between Tanzawa data and imported data, as I add features and capabilities to Tanzawa, I'll have the option to go back and pull in meta-data from Wordpress that I skipped on the initial import.
    πŸ”—permalink
  • Mar 25, 2021
    by James
    I've got the base interface for mapping categories to streams worked out. Adding a new stream directs you to the django admin, which isn't ideal from a user perspective, I kinda like it because modifying system data should be different.

    The base category mapping interface


    πŸ”—permalink
  • Mar 24, 2021
    by James
    Have got the base upload form working. After uploading the file it's automatically creating placeholder records for all post formats (Wordpress' build in Post Kind),Β  Categories, and Post Kinds.Β 

    But thinking more about the actual worflow, I think it will be better not automatically create those records and truly split it separate steps. So after uploading the file you're taken to a list page with a list of all uploaded Wordpress files.

    Next to each filename there will be five buttons: "Set Category Mapping", "Set Post Format Mapping" ,Β  "Set Post Kind Mapping" (if found), "Import Media", and "Import Posts".Β  The "Import Posts" button will be disabled until mapping has been setup and media has been imported.

    Uploading the file will automatically redirect you to the "Set CategoryΒ  Mapping" page, but if you leave the process midway through you'll be able to pickup where you left off.

    The base Wordpress import form
    πŸ”—permalink
  • πŸ”— What is the Small Web?

    Mar 23, 2021
    by James
    in Yokohama, Kanagawa Prefecture, Japan
    The Small Web is for people (not startups, enterprises, or governments). It is also made by people and small, independent organisations (not startups, enterprises, or governments).

    On the Small Web, you (and only you) own and control your own home (or homes).
    This is exactly what motivates me to work and build Tanzawa. The world needs a smaller web focused on people. The Small Tech principles are also bang on.
    1. Tagged with
    2. community
    3. internet
    πŸ”—permalink
  • The Week #37

    Mar 23, 2021
    by James


    • Technically this was last week, but my term as head of the neighborhood has come to an end. Although I was part of the physical education group (the most event heavy group), we didn't have a single event due to covid. Being new to the neighborhood and not renting, I was hoping to use this year to get more involved in my community and to get to know my neighbors / let my neighbors get to know me. Next year I'm the backup head of the block, so maybe that's still possible, once the vaccine rolls out.

    • Speaking of vaccines, my friends in the US and UK are starting to get their covid vaccinations. While we've had a fraction of the case load as them, I can't help but feel a bit jealous. We're still inoculating at a slower pace than I'd like to see, but in a month it's increased a hundred to topping topped 70k per day. It's at least going in the right direction.

    • I've decided to get a bicycle and went to a couple of shops to check out used ones. One was a one of Japan's great second hand stores, where they have a bunch of "used" products that are like new. And the other was a shop that specializes in used bikes. The staff was friendly and answered my stupid questions. I'd wouldn't mind buying my bike from them, but they didn't have the one I want.

    I don't know what it is - maybe just a lack of knowledge of bicycles in general, but I always hate going into bike shops. It's not a Japan thing, as I've noticed in US as well. I always feel some serious in-group/out-group energy. Just me?


  • I saw this cool project called Solar Protocol, which is an experiment to have a website hosted across the globe completely by solar power and sent from whichever sever has the most energy. I thought about volunteering as a server steward, but I'm not sure about how I can securely mount solar panel to my balcony, which has both great southern and western exposure (I'm not about to start climbing up on the roof).

  • Lately I've felt like our water bills are a bit higher than they should be. For many it's because they're now at home all day everyday, rather than in the office, so their usage has increased. But we've been at home all day everyday for about 3 years. Since we bought our house, I had always thought our water pressure almost too good. Turns out the taps were fully open. I cut them back 50% - 60% and they're still getting great flow. This should reduce our usage (and thus our bill), but it will take a month or two for us to find out just how much effect this 30 second fix will have.

  • πŸ”—permalink
  • 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
Previous 148 of 357 Next
Reply by email
Powered by
πŸ”Tanzawa

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

Web developer living in Japan.