Location: PHPKode > scripts > Blip API > blip-api/blipapi_shortlink.php
<?php

/**
 * Blip! (http://blip.pl) communication library.
 *
 * @author Marcin Sztolcman <marcin /at/ urzenia /dot/ net>
 * @version 0.02.15
 * @version $Id: blipapi_shortlink.php 39 2009-03-27 23:38:41Z urzenia $
 * @copyright Copyright (c) 2007, Marcin Sztolcman
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License v.2
 * @package blipapi
 */

/**
 * Blip! (http://blip.pl) communication library.
 *
 * @author Marcin Sztolcman <marcin /at/ urzenia /dot/ net>
 * @version 0.02.15
 * @version $Id: blipapi_shortlink.php 39 2009-03-27 23:38:41Z urzenia $
 * @copyright Copyright (c) 2007, Marcin Sztolcman
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License v.2
 * @package blipapi
 */

if (!class_exists ('BlipApi_Shortlink')) {
    class BlipApi_Shortlink implements IBlipApi_Command {
        /**
        * Get shortlinks from Blip!'s rdir system
        *
        * @param int $since_id status ID - will return statuses with newest ID then it
        * @param int $limit
        * @param int $offset
        * @access public
        * @return array parameters for BlipApi::__query
        */
        public static function read ($since_id=null, $limit=10, $offset=0) {
            if ($since_id) {
                $url = "/shortlinks/$since_id/all_since";
            }
            else {
                $url = '/shortlinks/all';
            }

            $params = array ();

            $limit = (int)$limit;
            if ($limit) {
                $params['limit'] = $limit;
            }
            $offset = (int)$offset;
            if ($offset) {
                $params['offset'] = $offset;
            }

            if (count ($params)) {
                $url .= '?'.BlipApi__arr2qstr ($params);
            }

            return array ($url, 'get');
        }
    }
}

Return current item: Blip API