<?php require_once '../lib/YahooMeme.class.php'; $meme = new Meme(); print "<h2>[info about bigo]</h2> <br />"; print $meme->get("bigodines")->toString(true); print "<h2>[people following bigodines]</h2> <br/>"; $repo = new MemeRepository(); foreach ($repo->following("bigodines") as $row) { print $row->toString() . "<br />"; } print "<h2>[bigo latest 5 posts]</h2>"; foreach ($meme->get("bigodines")->getPosts(0, 5) as $row) { print $row->toString() . "<br />\n"; } print "<h2>[meme popular posts]</h2> <br />"; $post = new Post(); foreach ($post->popular() as $row) { print $row->toString() . "<br />"; } print "<h2>[latest 5 posts from meme]</h2> <br />"; foreach ($post->search('sort:cdate', 0, 5) as $row) { print $row->toString() . "<br />\n"; }
} else { if ($action == "authorized") { $request_token = new OAuthConsumer($_SESSION['request_token_key'], $_SESSION['request_token_secret']); $response = $app->getAccessToken($request_token, $_GET['oauth_verifier']); parse_str($response, $params); $access_token = $params['oauth_token']; $access_token_secret = $params['oauth_token_secret']; $_SESSION['ACCESS_TOKEN'] = $access_token; $_SESSION['ACCESS_TOKEN_SECRET'] = $access_token_secret; } else { if ($action == "post") { $token = new OAuthToken($_SESSION['ACCESS_TOKEN'], $_SESSION['ACCESS_TOKEN_SECRET']); $app->token = $token; /* Congratulations! You've just logged in into Yahoo! and now are able to * post on meme :P' */ $meme = new MemeRepository(); $meme->insert($app, $_REQUEST['post_type'], $_REQUEST['content'], isset($_REQUEST['caption']) ? $_REQUEST['caption'] : null); print "<h1>CONGRATS! YOU DID IT</h1>"; } } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Yahoo! Meme posting example!</title> </head> <body> <p>The goal of this example is to show you how to add content to Meme using your own app ;P</p> <form name="post_text" method="GET"> <input type="hidden" name="action" value="post" />
protected function _followers($start = 0, $limit = 10) { if ($this->guid) { return parent::_followers($this->guid, $start, $limit, true); } return parent::_followers($this->name, $start, $limit); }
} else { if ($action == "authorized") { $request_token = new OAuthConsumer($_SESSION['request_token_key'], $_SESSION['request_token_secret']); $response = $app->getAccessToken($request_token, $_GET['oauth_verifier']); parse_str($response, $params); $access_token = $params['oauth_token']; $access_token_secret = $params['oauth_token_secret']; $_SESSION['ACCESS_TOKEN'] = $access_token; $_SESSION['ACCESS_TOKEN_SECRET'] = $access_token_secret; $content = $_SESSION['full_content']; $caption = $_SESSION['full_caption']; $token = new OAuthToken($_SESSION['ACCESS_TOKEN'], $_SESSION['ACCESS_TOKEN_SECRET']); $app->token = $token; /* Congratulations! You've just logged in into Yahoo! and now are able to * post on meme :P' */ $meme = new MemeRepository(); $meme->insert($app, $_REQUEST['post_type'], $content, isset($caption) && !empty($caption) ? $caption : null); print "<h1>CONGRATS! YOU DID IT (or not.. You'd better double check :P)</h1>"; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Yahoo! Meme posting example!</title> </head> <body> <p>The goal of this example is to show you how to add content to Meme using your own app ;P</p> <form name="post_text" method="GET"> <input type="hidden" name="action" value="request_token" /> <select name="post_type">