</a></div> <?php } ?> <?php } } ?> <?php $api = new clAPI('http://gdata.youtube.com/feeds/api/standardfeeds/most_recent'); $api->param('v', 2); if ($api->parse('1 hour')) { ?> <h4><?php echo $api->get('title'); ?> </h4> <?php $api->info(); ?> <?php foreach ($api->get('entry', 10) as $entry) { ?> <?php // this nasty bit extracts the video id from entry@id: preg_match('/video:([^\\:]+)/i', $entry->get('id'), $matches); $id = $matches[1]; ?> <?php if ($id) {
<?php require_once '../src/coreylib.php'; clAPI::configure('debug', true); $feedburner_uri = 'coreylib-cookbook'; $api = new clAPI('https://feedburner.google.com/api/awareness/1.0/GetFeedData'); $api->param('uri', $feedburner_uri); if ($api->parse('10 minutes')) { ?> <h4><?php echo $api->get('feed@uri'); ?> </h4> <p> <?php echo $api->get('feed/entry[0]@hits'); ?> hits as of <?php echo date('F j', strtotime($api->get('feed/entry[0]@date'))); ?> </p> </p> <?php }
$api = new clAPI('http://api.flickr.com/services/rest'); $api->param('method', 'flickr.people.getPublicPhotos'); $api->param('api_key', ''); $api->param('user_id', ''); $api->param('page', 1); $api->param('per_page', 12); ?> <?php if ($api->parse('1 hour')) { ?> <?php $api->info(); ?> <?php foreach ($api->get('photos/photo', $flickrCount) as $photo) { ?> <li><a href="http://www.flickr.com/photos/netgeek/<?php echo $photo->get('@id'); ?> "><img src="http://farm<?php echo $photo->get('@farm'); ?> .static.flickr.com/<?php echo $photo->get('@server'); ?> /<?php echo $photo->get('@id'); ?> _<?php
<?php require_once "../src/coreylib.php"; ?> <?php $api = new clAPI("http://twitter.com/statuses/public_timeline.xml"); if ($api->parse('10 minutes')) { ?> <?php $status = $api->get('status[5]'); ?> <div><?php echo $status->renderTwitterLink(); ?> </div> <?php }
$api->basicAuth($twitter_username, $twitter_password); echo date('r', time()); ?> <div id="twitter"> <div id="twitter_div"> <h2 class="twitter">Latest Updates <span> » Twitter</span></h2> <ul id="twitter_update_list"> <?php if ($api->parse('1 hour')) { ?> <ul> <?php foreach ($api->get('status') as $post) { ?> <?php $tweet = $post->get('text'); // Convert URL's with protocol prefix $tweet = ereg_replace("[a-zA-Z]+://([-]*[.]?[a-zA-Z0-9_/-?&%])*", "<a href=\"\\0\">\\0</a>", $tweet); //Convert URL with just www. $tweet = ereg_replace("(^| |\n)(www([-]*[.]?[a-zA-Z0-9_/-?&%])*)", "\\1<a href=\"http://\\2\">\\2</a>", $tweet); //Convert # hashtags $tweet = ereg_replace("(^| |\n)(\\#([-]*[.]?[a-zA-Z0-9_/-?&%])*)", "\\1<a href=\"http://search.twitter.com/search?q=\\2\">\\2</a>", $tweet); $tweet = str_replace("/#", "/", $tweet); //Convert @ replies $tweet = ereg_replace("(^| |\n)(\\@([-]*[.]?[a-zA-Z0-9_/-?&%])*)", "\\1@<a href=\"http://www.twitter.com/\\2\">\\2</a>", $tweet); $tweet = str_replace("/@", "/", $tweet); $tweet = str_replace(">@", ">", $tweet);
<?php require_once '../src/coreylib.php'; clAPI::configure('debug', true); $api = new clAPI('http://feeds.feedburner.com/bassistscom'); if ($api->parse('1 hour')) { ?> <?php $api->info(); ?> <h4><a href="<?php echo $api->get('channel/link'); ?> "><?php echo $api->get('channel/title'); ?> </a></h4> <ul> <?php foreach ($api->get('channel/item', 10) as $item) { ?> <li><a href="<?php echo $item->get('link'); ?> "><?php echo $item->get('title'); ?> </a></li> <?php } ?>
?> <?php require_once "../src/coreylib.php"; ?> <?php $api = new clAPI("http://karlacollegeman.com/feed/"); if ($api->parse('10 minutes')) { ?> <?php $api->info(); ?> <?php foreach ($api->get('channel/item') as $item) { ?> <a href="<?php echo $item->get('link'); ?> "><?php echo $item->get('title'); ?> </a> <p><?php echo $item->get('content:encoded'); ?> </p> <?php } }
clAPI::configure('debug', true); $api_key = ''; $login = ''; $api = new clAPI('http://api.bit.ly/shorten'); $api->param('longUrl', 'http://collegeman.net'); $api->param('version', '2.0.1'); $api->param('apiKey', $api_key); $api->param('login', $login); $api->param('format', 'xml'); ?> <?php if ($api->parse()) { ?> <?php if ($api->get('errorCode') == '0') { ?> <?php $api->info('results'); ?> <?php echo $api->get('results/nodeKeyVal/shortUrl'); ?> <?php } else { ?> <?php $api->info(); ?> <?php }
$api->basicAuth($delicious_username, $delicious_password); if ($api->parse('5 minutes')) { ?> <?php $api->info(); ?> <h4><a href="http://delicious.com/"<?php echo $delicious_username; ?> ">Delicious/<?php echo $delicious_username; ?> </a></h4> <ul> <?php foreach ($api->get('post') as $post) { ?> <li style="clear:both;"> <a href="<?php echo $post->get('@href'); ?> "><?php echo $post->get('@description'); ?> </a><br /> <?php if ($post->has('@tag')) { $tags = split(' ', $post->get('@tag')); ?> <span style="display:block; float: left;">[ </span><ul style="list-style-type:none; padding:0; margin:0;"> <?php
<?php require_once '../src/coreylib.php'; clAPI::configure('debug', true); $api = new clAPI('http://feeds.feedburner.com/typepad/sethsmainblog'); $api->curlopt(CURLOPT_USERAGENT, "feedburnerclient"); if ($api->parse()) { ?> <?php $api->info(); ?> <h4><a href="<?php echo $api->get('link[0]@href'); ?> "><?php echo $api->get('title'); ?> </a></h4> <ul> <?php foreach ($api->get('entry', 10) as $entry) { ?> <li><a href="<?php echo $entry->get('link[0]@href'); ?> "><?php echo $entry->get('title'); ?> </a></li> <?php }
margin: 0 0 10px 0; } </style> <ul> <?php /** * @param $text The text of a Twitter status update * @return The status with typical linking to users and URLs */ function tweet($text) { $text = preg_replace('#http://[^ ]+#i', '<a href="\\0">\\0</a>', $text); $text = preg_replace('/@([a-z0-9_]+)/i', '<a href="http://twitter.com/\\1">\\0</a>', $text); return $text; } // foreach status update in the feed foreach ($api->get('status') as $status) { // start a list item echo '<li>'; // spit out the text of the status update echo tweet($status->get('text')); // create a link to the tweet $author = $status->get('user/screen_name'); $id = $status->get('id'); echo " <a href=\"http://twitter.com/{$author}/statuses/{$id}\">»</a>"; // close the list item echo '</li>'; } ?> </ul>