Ruby, Cron and Instagram

Instagram is an effective visual medium to help you keep your marketing effort in high gear. But you need a way to tie it to all your other online social activities so that your followers can get a centralized view. For example, you may want to link your latest four Instagram postings to your blog by offering a picture and a link for each entry on your blog’s landing page.

This article describes how you can use Instagram’s API to capture your latest activity and periodically (e.g.; every 15 minutes) update your website. It uses Ruby to do the hard work, and runs periodically using a Linux cron job.
Continue reading

Avoiding the Ruby Run-On Sentence

The run-on sentence can be defined as two or more independent clauses that have been joined without an accompanying coordinating conjunction. Run-on sentences carry multiple thoughts, which confuses the reader.

So what does this have to do with Ruby? Well, it is this author’s opinion that run-on sentences can be a sign of danger when describing your program objectives. Each objective within your program should be conveyed in as simple terms as possible, without having to glue together lots of disparate thoughts.

Fortunately, this is fairly easy in Ruby, as it really excels in describing complex concepts in a very terse manner, allowing you to express yourself clearly.
Continue reading

Simple Internationalization in Ruby Sinatra

Internationalization is such a long word that people commonly refer to it simply as “i18n”. If it’s not already obvious, the number “18” refers to the number of characters between the “i” and the final “n”. It’s a complicated word, and similarly, internationalization can be a complicated beast to tame in your web pages, assuming you want to appeal to an international audience.

Some people approach the internationalization problem by creating entirely new web pages, which essentially results in a parallel website for each language. I don’t know about the latest version of Drupal, but Drupal 5.0 forced you into this very paradigm. What a nightmare to implement this approach and maintain a parallel website for each language! The situation gets really complicated when you want to link to another page within a different language. You have to go through and change each link for each of your parallel websites. It gets even more complicated if a target page in a specific language is not yet available because it hasn’t been translated yet.
Continue reading