Hive Developer Portal
This tutorial shows you how to get blogs details from the specified author, limited to five results.
In this tutorial, we will see how to get blog feed from the selected author with hive-php-lib. You can also find the result PHP file in the
/resources/examples/blogFeed.php file in
<?php /* Load Composer for autoload libs */ require __DIR__ . '/vendor/autoload.php'; /* Declase use statement to add Hive Condenser lib */ use Hive\PhpLib\Hive\Condenser as HiveCondenser; /* Create config array and fill with settings */ $config = [ "debug" => false, "disableSsl" => false, "heNode" => "api.hive-engine.com/rpc", "hiveNode" =>"anyx.io", ]; /* Instantiate Hive Condenser object */ $hiveApi = new HiveCondenser($config);
Now, use the
This function needs two variables to work:
$tag: (string) to have the author to fetch,
$limit: (int) to know how much posts to fetch.
$tag = 'bambukah'; $limit = 5; $result = $hiveApi->getDiscussionsByBlog($tag, $limit);
$result will be an array with all data. To display them, just
print_r() the first element:
Now, you have an array with five posts from @bambukah and you have all the details for each post.