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.

Fri, 16 Mar 2018

I am still working on my BlogPoster app

I am still working on my BlogPoster app, which will take a URL pasted into a terminal, grab the web page's title and make that title and link the basis for a blog and social post.

The app is written in Ruby and uses the Nokogiri and Twitter gems, among others. I have code that will allow me to eliminate Nokogiri, but that's a fairly "light" gem. The Twitter gem, which makes posting via the Twitter API easy, has a lot of dependencies, and that is the one I'd really like to get rid of in favor of native code.

But that's getting ahead of myself. The app, as it stands now, is a huge if/then loop with a lot of ungainly code. I did add some code that keeps the app from crashing if Nokogiri doesn't get a "real" (i.e. live) web page, or there are connectivity problems.

What I am doing now is re-writing the app with distinct and separate methods, which I'm thinking of as functions that can allow for more modularity and code reuse. I probably should be using Ruby classes to organize these methods, but I'm saving that for the next rewrite. Going from a monolith with a lot of repeated code to a bunch of modules (still probably accessed via an if/then structure, albeit a much shorter and manageable one) is enough improvement for the next version.

For the next version, I hope to have a GUI. I'm leaning toward the Tk toolkit because this app isn't very complicated, and Tk is probably the most well-known of a very motley bunch of desktop GUI solutions for Ruby. It may be a little ugly, but it is cross-platform, which is what I have been aiming for. I am open to other GUI toolkits, but even this recent article, An overview of desktop Ruby GUI development in 2018 doesn't offer much hope.

I'm also considering a full rewrite in another language. I'm working on Racket right now, but I'd have to figure out a lot of things to make it happen.