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.

Wed, 13 Jan 2016

The Counter addin, version 2, for Ode sites

I've been meaning to get back into the Counter addin that I wrote for Ode with Rob's help, and over the past few days I added some functionality to the code and deployed it on my site, where you can see the results in the right rail.

The original Counter addin only counted posts, which in my case are files in the documents directory with .txt suffixes.

Since I now create many of my social-media updates with Ode, I added some code to count those entries and report how many of the overall entries are "full" posts and how many are social updates.

While I was in there, I wanted to play around with regular expressions, so I also added a count for the number of jpg and png images both in the entire documents directory (which includes themes) as well as in my images directory (where I try to keep all images that go into posts).

It's definitely fun to write a very little bit of Perl and have something happen on my live site. It's a nice feeling, for sure.

The addin uses the File::Find CPAN module to crawl your filesystem and count the files.

The way the Counter addin works is that you download it (for now I'm hosting it here) and unzip it, stash the addin's directory/folder in your addins directory (mine is under /data/addins), add some HTML with calls to the addin to your theme (generally in the sidebar area), and it should just work.

Once again, thanks to Rob Reed for creating Ode and helping me get off the ground with this addin.

If you missed the link above, download the new Counter addin from my site.

I still have some code cleanup to do, and I will probably add some documentation, licensing information and acknowledgments. But this version does work.

In the future, I can see this addin, or something like it, creating even more dynamic (or even static) content for the sidebar of an Ode site. It could help build a list of directories and certainly could provide more statistics on how many posts you have under any given directory.

But for now I can instantly see how many posts and social updates I have written (and you can, too).