Exemplo n.º 1
0
<?php

include_once 'header.php';
// Include needed files
include_once "../../ScoopIt.php";
// Construct scoop var, which handle API communication
$scoop = new ScoopIt(new SessionTokenStore(), "", $consumerKey, $consumerSecret);
$interests = $scoop->getCustomRequest("interest-list");
?>

	Interrests available
	<ul>
		<?php 
foreach ($interests->interests as $interest) {
    echo "<li>{$interest->name} (id:<a href='interest.php?id={$interest->id}'>{$interest->id}</a> shorname:<a href='interest.php?shortName={$interest->shortName}'>{$interest->shortName})</a></li>";
}
?>
	</ul>
	<hr/>
	<p>
		Raw Content of profile Query:<br/>
		<textarea style="width:600px; height: 200px">
		<?php 
print_r($interests);
?>
		</textarea>
	</p>

<?php 
include_once 'footer.php';
Exemplo n.º 2
0
//Pagination
$postPerPage = 30;
$page = 0;
if (isset($_GET["page"])) {
    $page = intval($_GET["page"]);
}
$request = "interest";
if (isset($interestId)) {
    $request = $request . "?id=" . $interestId;
} else {
    if (isset($interestShortName)) {
        $request = $request . "?shortName=" . $interestShortName;
    }
}
$request = $request . "&getPosts=true&page=" . $page . "&count=" . $postPerPage;
$interest = $scoop->getCustomRequest($request)->interest;
//next and previous
$paginationUrl = "";
if (isset($interestId)) {
    $paginationUrl = $paginationUrl . "?id=" . $interestId;
} else {
    if (isset($interestShortName)) {
        $paginationUrl = $paginationUrl . "?shortName=" . $interestShortName;
    }
}
if ($page > 0) {
    $prev = $paginationUrl . "&page=" . ($page - 1);
}
if ($topic->curatedPostCount / $postPerPage > $page + 1) {
    $next = $paginationUrl . "&page=" . ($page + 1);
}