<?php /** * The Getter object has one method: * * getItems($quantity, $hours, $scoring, $metadata) * * $quantity (int): Number of links desired. Default 20. * $hours (int): How far back to look for links. Default 24. * $scoring (bool): TRUE to employ "freshness vs. quality" algorithm * or FALSE to simply return most frequently tweeted links. Default TRUE. * $metadata (bool): TRUE to hydrate URLs with Embed.ly metadata. * An API key must be set in config.php. Default FALSE. */ require __DIR__ . '../../init.php'; use OpenFuego\app\Getter; $fuego = new Getter(); $items = $fuego->getItems(20, 24, TRUE, TRUE); // quantity, hours, scoring, metadata print '<pre>'; print_r($items); print '</pre>';
<?php /** * Slightly modified version of the Getter example that came with the Fuego installation * */ require __DIR__ . '../../init.php'; use OpenFuego\app\Getter; $quantity = isset($_REQUEST['fuegoQuantity']) ? $_REQUEST['fuegoQuantity'] : 20; $hours = isset($_REQUEST['fuegoHours']) ? $_REQUEST['fuegoHours'] : 24; $scoring = isset($_REQUEST['fuegoScoring']) ? $_REQUEST['fuegoScoring'] : TRUE; $metadata = isset($_REQUEST['feugoMetadata']) ? $_REQUEST['feugoMetadata'] : TRUE; $fuego = new Getter(); $items = $fuego->getItems($quantity, $hours, $scoring, $metadata); // quantity, hours, scoring, metadata echo json_encode($items);
<?php /** * The Template for displaying all single posts. * * @package Independent Publisher * @since Independent Publisher 1.0 template name: Trending */ $pageBodyID = "trending"; require dirname(__FILE__) . '/../../fuego/init.php'; use OpenFuego\app\Getter; $fuego = new Getter(); if (isset($_GET['hideLink']) && current_user_can('publish_posts')) { $fuego->hideLink($_GET['hideLink']); } get_header(); ?> <div id="main" class="site-main"> <div id="primary" class="content-area"> <main id="content" class="site-content" role="main"> <div class="usa-grid-full"> <header class="page-header bbg-page__header" style="margin-bottom: 1.5rem;"> <div class="bbg-avatar__container bbg-team__icon"> <div class="bbg-avatar bbg-team__icon__image" style="background-image: url(<?php echo get_template_directory_uri(); ?> /img/icon_trending.png);"></div> </div> <div class="usa-intro bbg-page__header-text bbg-team__text">
} if (isset($_GET['maxItems'])) { $maxItems = $_GET['maxItems']; } if (isset($_GET['hours'])) { $hours = $_GET['hours']; } if ($algo == "smart") { $requireQuality = true; } $recentChecked = $algo == 'recent' ? 'checked' : ''; $smartChecked = $algo == 'smart' ? 'checked' : ''; $rssChecked = $displayFormat == 'rss' ? 'checked' : ''; $jsonChecked = $displayFormat == 'json' ? 'checked' : ''; $humanChecked = $displayFormat == 'human' ? 'checked' : ''; $fuego = new Getter(); if ($showConsole) { ?> <script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'></script> <script type='text/javascript'> function onSubmit(){ var weightedCount=document.getElementById('weightedCount').value; var displayFormat = document.getElementById('displayFormat').checked; return false; } </script> <form onSubmit='onSubmit();'> <label for='minWeightedCount'>Minimum Weighted Count</label><input id='minWeightedCount' name='minWeightedCount' type='text' value='<?php echo $minWeightedCount; ?>