• Current status

  • Är med hund idag, resultatet av en 4h promenad … mission accomplished

  • I’m apparently an excellent teacher where the students fight about the chance to listen to me 😋

  • When you have to go, you have to go !!

  • An idea and 365 days

    In July last year, I decided to try to do a “365 project”, i.e., take one photo every day and publish it. I’ve tried this before, but I’ve never succeeded in getting more than 150 days or so before quitting. I think the main reason was that I took it too seriously and tried too hard to make a “good” photos. This was stressful and caused me to quit the whole thing. This time I decided that it was enough to have a photo … no matter how bad it was.

    I set a goal of 200 photos, i.e., a personal high score. Well, yesterday I managed to publish my 365th photo and thus completing my 365 project. Yay !!!! You can find them here (as a blog) or here (as a photo album) if you want to see them.

    So, what was my experience of this project? I think it was rather fun, there were of course days when I really didn’t feel like taking a photo and a few days when I almost missed it. But I think it was a good experience, and I learned a few things that I haven’t thought about too much before, my favorite is that small details + the environment can make a photo more interesting. And that it’s always possible finding something to photograph.

    Will I continue? Hmmm, I don’t think I’ll continue with one photo per day. I would like the posts to be a bit more freeform, i.e., allowing more than one photo and also more text. I really like the combination of photos and text, think small stories. I’ll see what I end up doing … if I continue.

  • Ojojoj, hur ska detta gå

  • MBPC day 4: Thorny. Spring is so ugly

  • Daily life viewed from above

  • MBPC day 3: Experimental. Being uninspired I decided to try a longtime exposure. Result: a huge “meh”

  • MBPC day 2: Photo. I should print more

  • MBPC day 1: Switch. Trying out an ereader to see if I should switch

  • Hmmm, I downloaded the mastodon iOS app and I think it’s slightly confused. Three languages in one dialog … two isn’t uncommon but three isn’t something I see every day

  • It’s important to enjoy whatever snow that is left (he loves snow).

  • Så sant

  • Micro.blog to blot script

    Just so I remember this in case I ever need it again

    # This script assumes it's launched from inside the micro.blog export folder
    
    import frontmatter
    import os
    import re
    import shutil
    from dateutil import parser
    
    basedir = '/Users/jem/Desktop/TestOutput'
    imgpat = re.compile('')
    domainpat = re.compile('https:.*/uploads/')
    blothead = 'title: {}\ndate: {}\n\n'
    
    # I really dislike doing this but ...
    imgdata = {'destdir':'',}
    
    def copyimage(src,dest):
        shutil.copy(os.path.join('uploads',src), os.path.join(imgdata['destdir'],dest))
        
    def imgproc(m):
        orgpath = m.group(1)
        
        # Remove domain info
        p = domainpat.sub('',orgpath)
        n = '_'+os.path.basename(p)
        copyimage(p,n)
        return '![]('+n+')'
    
    def formatblotpost(post):
        # Update content and copy image files
        modifiedcontent = imgpat.sub(imgproc,post.content)
        if post.metadata['title'] == '':
            post.metadata['title'] = post.metadata['datetitle']
        return blothead.format(post.metadata['title'],post.metadata['date']) + modifiedcontent
            
    def create_destdir(newbase,curfilepath,poststamp):
        (odir,oname) = os.path.split(curfilepath)
        newdir = os.path.join(newbase,odir)
        # Check if the dest dir exists, this should be the year & month folder
        if not os.path.isdir(newdir):
            os.makedirs(newdir)
        postdir = os.path.join(newdir,poststamp)
        # This should not be possible but ...
        if os.path.isdir(postdir):
            raise Exception('Post dir already exists')
        else:
            os.mkdir(postdir)
        return postdir
    
    def handlepost( destdir, source ):
        print(source)
        
        try:
            postcontent = frontmatter.load(source)
            meta = postcontent.metadata
            pdate = parser.parse(meta['date'])
            pdir = create_destdir(destdir,source,pdate.strftime('%Y%m%d_%H%M%S'))
            postcontent['datetitle']= pdate.strftime('%Y-%m-%d %H:%M:%S')
            # Deep sigh
            imgdata['destdir'] = pdir
    
            # Create actual post
            of = open(os.path.join(pdir,'index.md'),'w')
            of.write(formatblotpost(postcontent))
            of.close()
        except FileNotFoundError as arg:
            print(arg)
    
    for root, dirs, files in os.walk('.'):
        if not 'uploads' in root:
            for f in files:
                if not '.DS_Store' in f:
                    handlepost(basedir,os.path.join(root,f))
    
  • I needed a walk today so I persuaded a friend to come along (the persuasion consisted of holding up the collar 😋)

RSS