Title photo
frugal technology, simple living and guerrilla large-appliance repair

Regular blog here, 'microblog' there

Many of my traditional blog post live on this site, but a great majority of my social-style posts can be found on my much-busier microbloging site at updates.passthejoe.net. It's busier because my BlogPoster "microblogging" script generates short, Twitter-style posts from the Linux or Windows (or anywhere you can run Ruby with too many Gems) command line, uploads them to the web server and send them out on my Twitter and Mastodon feeds.

I used to post to this blog via scripts and Unix/Linux utilities (curl and Unison) that helped me mirror the files locally and on the server. Since this site recently moved hosts, none of that is set up. I'm just using SFTP and SSH to write posts and manage the site.

Disqus comments are not live just yet because I'm not sure about what I'm going to do for the domain on this site. I'll probably restore the old domain at first just to have some continuity, but for now I like using the "free" domain from this site's new host, NearlyFreeSpeech.net.

Tue, 26 Dec 2017

Steady work on rewrite of the BlogPoster app

I have been working steadily on the BlogPoster app, both tightening up the current "production" version and slowly coding the new "modular" version based on Ruby blocks.

Over the weekend I coded up a few blocks in what I hope will be a very atomized app in which all of the blocks do just about one thing and can be called upon in various combinations for different tasks.

Today I worked on the regexes for creating filenames based on post title. The hardest part is dealing with strange characters and website <title> text that contains lots of linefeeds. (Confession: This site did the same until I fixed it. Please don't put linefeeds in your <title>.)

I got rid of the extra linefeeds, but I was ending up with occasional doubled underscores (my go-to replacement character for the space between words). I came up (i.e. Googled and stole) the regex for "match two or more of this character," which in this case is __+, and I was off to the races. I also figured out that in HTML titles with extra lines, I was inadvertently adding an underscore to the beginning of a string, and I used ^_ to find that and kill it out. Regex is fun and profitable.

Hopefully I'll get back to working on the "new" version. I'm coding it slowly and deliberately because I don't want it to be a mess. Next version will be more object-oriented (i.e. will use classes) if I can figure that out. First we'll see how this version turns out,