create a PHP file for your blog called "blog.php" add the snippet below anywhere you want the html for your blog to be inserted. Keep in mind, the HTML will be totally un-styled so you may have to do a little CSS work to match your site's formatting and style.

<?php include("include/return_blog.php"); ?>

Next create a file called "return_blog.php" with the code below in it. Be sure to update the pertinent variables (read my comments in the code snippet). Put this file into a sub-folder called "include"

// Blog Widget
// This code turns your project logs into a simple blog for your external website


// enter your api key

// enter your project id, you can find it in the url of your project
$project_id = "XXXX";

// enter your blog url, for my blog it is
$blog_url = "http://xxxx";

// number of logs to display per page
$logs_per_page = 4;

// if $log_page is not set, default $log_page to 1 
$log_page = ($_GET["log_page"] ? $_GET["log_page"] : 1);

// import json data from API
// get project object
$project_object = json_decode(file_get_contents("".$project_id."?api_key=".$api_key),true);
// get array of project log objects (starting at $log_page, quantity limited by $logs_per_page)
$log_objects_array = json_decode(file_get_contents("".$project_id."/logs?api_key=".$api_key."&sortby=newest&page=".$log_page."&per_page=".$logs_per_page),true);

// store the project url in a variable, this is the base for the individual log URLs
$project_url = $project_object['url'];
// store the total number of logs for this project in a variable
$project_numlogs = $project_object['logs'];

// loop through the log_objects_array and spit out HTML
foreach($log_objects_array['logs'] as $log) {
  $log_title = $log['title'];
  $log_body = $log['body'];
  $log_id = $log['id'];
  $log_date = $log['created'];
  // get the main comment object for each log
  $log_comments = json_decode(file_get_contents("".$log_id."?api_key=".$api_key),true);
  // Print the log title and body
  echo '
     <h2><a href="'.$project_url.'/log/'.$log_id.'" target="_blank">'.$log_title.'</a><br/>
      <small>'.date('M-d Y', $log_date).'</small>

  // Print log comments (if there are any for this log)
  if ($log_comments['total']) {
    echo '<h3>COMMENTS:</h3>';  
    print_comments($log_comments['comments']); // magic function

  // Print the remainder of HTML
  echo '
} // end loop through logs

// Print bottom nav
  echo '
  if($log_page > 1) {
    echo '
    <a href="'.$blog_url.($log_page-1).'">&#60;&#60; Newer</a>&nbsp;&nbsp;&nbsp;
  if ($log_page+1 <= $project_numlogs/$logs_per_page) {
    echo '
    <a href="'.$blog_url.($log_page+1).'">Older &#62;&#62;</a>
  echo '

// print_comments function
function print_comments($comments) {
  // loop through comments array
  echo '<ul>';
  foreach($comments as $comment_object1) {        
    // find and print first tier comments 
    if($comment_object1['reply_to'] == 0) {
      echo '
      <p><a href="'.$comment_object1['user']['url'].'" target="_blank">'.$comment_object1['user']['screen_name'].'</a><br />
      // loop through comments array again to find second tier comments
      echo '<ul>';
      foreach($comments as $comment_object2) {
        // find and print second tier comments replying to the above tier comment
        if($comment_object2['reply_to'] == $comment_object1['id']) {
          echo '
          <p><a href="'.$comment_object2['user']['url'].'" target="_blank">'.$comment_object2['user']['screen_name'].'</a><br />
          // loop through comments array third time to find third tier comments
          echo '<ul>';
          foreach($comments as $comment_object3) {
            // find and print third tier comments replying to the second tier comment
            if($comment_object3['reply_to'] == $comment_object2['id']) {
              echo '
              <p><a href="'.$comment_object3['user']['url'].'" target="_blank">'.$comment_object3['user']['screen_name'].'</a><br />
          echo '</ul>'; // end third tier comments
      echo '</ul>'; // end second tier comments
  echo '</ul>'; // end first tier comments
} // end print_comments()


Add the lines of code below to your website's .htaccess file (you can create one with a text editor if you don't already have one). This just hides the php file extension and the browser variable for log_page that gets passed in. Fairly standard practice these days.

RewriteEngine On

RewriteRule ^blog/([^/\.]+)/?$ blog.php?log_page=$1 [L]