require('workflows.php'); $w = new Workflows(); // Grab input and build query url string $in = "{query}"; $url = "https://ruk.ca/search-json?keyword=" . urlencode($in); // Grab the data from Amazon $str = $w->request( $url ); $results = json_decode($str); if (count($results->nodes) == 0) { $w->result( time(), $in, 'No Posts', 'No posts found. Search ruk.ca for '.$in, 'icon.png', 'yes' ); } else { foreach ($results->nodes as $key => $node) { $w->result( time(), $node->node->path_alias, $node->node->label, $node->node->path_alias, 'icon.png', 'yes', $node->node->label ); } } // Return the result xml echo $w->toxml();