Hive Developer logo

Hive Developer Portal

RB: Blog Feed

This example will output blog details to the terminal for the author specified, limited to five results.

Full, runnable src of Blog Feed can be downloaded as part of: tutorials/ruby (or download just this tutorial:

Also see:



The script parses the creation date, assuming Zulu timezone (AKA UTC).

The output will be the latest five posts/reblogs for the account specified. If the author is the same as the account specified, it is assumed to be a post by this account. Otherwise, it is assumed to be a reblog.

It also counts the words in the content body by splitting the text into an array of strings, delimited by whitespace.

Finally, it creates the canonical URL by combining parent_permlink, author, and permlink.

To Run

First, set up your workstation using the steps provided in Getting Started. Then you can create and execute the script (or clone from this repository):

git clone
cd devportal/tutorials/ruby/01_blog_feed
bundle install
ruby blog_feed.rb hiveio

Example Output

2021-02-14 08:16:03 UTC
  Post: Around the Hive: Reflections
  By: hiveio
  Words: 423
2021-01-07 04:00:48 UTC
  Post: Hive and Kyros Ventures AMA
  By: hiveio
  Words: 2374
2020-12-16 19:13:36 UTC
  Post: GetBlock x Hive : Providing Hive Node Services, Presenting at HiveFest, and a HIVE Giveaway
  By: hiveio
  Words: 602
2020-11-12 01:20:36 UTC
  Post: Hive x Beaxy Livestream AMA - Answering Community Questions and HIVE Up for Grabs!
  By: hiveio
  Words: 258
2020-10-22 18:59:54 UTC
  Post: Beaxy HIVE Listing Announcement
  By: hiveio
  Words: 419