示例#1
0
include_once "ScoopIt.php";
include_once "config.php";
// Construct scoop var, which handle API communication
$scoop = new ScoopIt(new SessionTokenStore(), $localUrl, $consumerKey, $consumerSecret);
// Login in, if not previously logged in, it will issue a redirection
// to scoop.it servers to log the user in.
// You can omit the call below if you want to use the api in "anonymous"
// mode.
$scoop->login();
?>
<html>
	<title>Scoop.it API Test</title>
<body>
	<?php 
// Get the current user
$currentUser = $scoop->profile(null)->user;
// Display the current user name
echo "<h1>Hello " . $currentUser->name . "</h1>";
// Get information about topic with 24001 lid (this can be also
// called in anonymous mode).
$topic = $scoop->topic(24001);
echo "<h2>Information about topic: <img width='32px' src='" . $topic->mediumImageUrl . "' /><i> " . $topic->name . "</i></h2>";
echo "<p>Here is the print_r() output for the object \$topic:</p>";
echo "<center>";
echo "<textarea>";
print_r($topic);
echo "</textarea>";
echo "</center>";
?>
	<div id="footer">
		<a href=" http://www.scoop.it">
示例#2
0
<?php

include_once 'header_inc.php';
// Include needed files
include_once "../../ScoopIt.php";
// Construct scoop var, which handle API communication
$scoop = new ScoopIt(new SessionTokenStore(), "", $consumerKey, $consumerSecret);
//resolve profile
$profile = $scoop->profile(null);
include_once 'header_html.php';
?>

	Your short name is: <code><?php 
echo $profile->user->shortName;
?>
</code>
	<br/>
	<hr/>
	
	Topics you are curating are:
	<ul>
		<?php 
foreach ($profile->user->curatedTopics as $topic) {
    echo "<li>{$topic->name} (<a href='postsToCurate.php?id={$topic->id}'>posts to curate</a>)</li>";
}
?>
	</ul>
	
	<hr/>
	<p>
		Raw Content of profile Query:<br/>