API Documentation

Zend/Service/Delicious.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Service  
Subpackage
Delicious  
Version
$Id: Delicious.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Service_Delicious

Package: Zend\Service\Delicious

Zend_Service_Delicious is a concrete implementation of the del.icio.us web service

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  API_URI = 'https://api.del.icio.us'
Constant  PATH_UPDATE = '/v1/posts/update'
Constant  PATH_TAGS = '/v1/tags/get'
Constant  PATH_TAG_RENAME = '/v1/tags/rename'
Constant  PATH_BUNDLES = '/v1/tags/bundles/all'
Constant  PATH_BUNDLE_DELETE = '/v1/tags/bundles/delete'
Constant  PATH_BUNDLE_ADD = '/v1/tags/bundles/set'
Constant  PATH_DATES = '/v1/posts/dates'
Constant  PATH_POST_DELETE = '/v1/posts/delete'
Constant  PATH_POSTS_GET = '/v1/posts/get'
Constant  PATH_POSTS_ALL = '/v1/posts/all'
Constant  PATH_POSTS_ADD = '/v1/posts/add'
Constant  PATH_POSTS_RECENT = '/v1/posts/recent'
Constant  JSON_URI = 'http://del.icio.us'
Constant  JSON_POSTS = '/feeds/json/%s/%s'
Constant  JSON_TAGS = '/feeds/json/tags/%s'
Constant  JSON_NETWORK = '/feeds/json/network/%s'
Constant  JSON_FANS = '/feeds/json/fans/%s'
Constant  JSON_URL = '/feeds/json/url/data'

Properties

Propertyprotectedstring  $_authPass= ''

Password

Details
Type
string
Propertyprotectedstring  $_authUname= ''

Username

Details
Type
string
Propertyprotectedfloat  $_lastRequestTime= '0'
static

Microtime of last request

Default value0Details
Type
float
Propertyprotected\Zend_Service_Rest  $_rest= ''

Zend_Service_Rest instance

Details
Type
\Zend_Service_Rest

Methods

methodpublic__construct( string $uname = null, string $pass = null ) : void

Constructs a new del.icio.us Web Services Client

Parameters
Name Type Description
$uname string

Client username

$pass string

Client password

methodprivate_evalXmlResult( \DOMDocument $response ) : void
static

Evaluates XML response

Parameters
Name Type Description
$response \DOMDocument
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodprivate_parseXmlPostList( \DOMDocument $response ) : \Zend_Service_Delicious_PostList

Constructs Zend_Service_Delicious_PostList from XML response

Parameters
Name Type Description
$response \DOMDocument
Returns
Type Description
\Zend_Service_Delicious_PostList
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodprivate_xmlResponseToArray( \DOMDocument $response, string $root, string $child, string $attKey, string $attValue ) : array
static

Transform XML string to array

Parameters
Name Type Description
$response \DOMDocument
$root string

Name of root tag

$child string

Name of children tags

$attKey string

Attribute of child tag to be used as a key

$attValue string

Attribute of child tag to be used as a value

Returns
Type Description
array
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodpublicaddBundle( string $bundle, array $tags ) : \Zend_Service_Delicious

Adds a new bundle

Parameters
Name Type Description
$bundle string

Name of new bundle

$tags array

Array of tags

Returns
Type Description
\Zend_Service_Delicious Provides a fluent interface
methodpubliccreateNewPost(  $title,  $url ) : \Zend_Service_Delicious_Post

Create new post

Parameters
Name Type Description
$title
$url
Returns
Type Description
\Zend_Service_Delicious_Post
methodpublicdeleteBundle( string $bundle ) : \Zend_Service_Delicious

Delete a bundle

Parameters
Name Type Description
$bundle string

Name of bundle to be deleted

Returns
Type Description
\Zend_Service_Delicious Provides a fluent interface
methodpublicdeletePost( string $url ) : \Zend_Service_Delicious

Delete a post

Parameters
Name Type Description
$url string

URL of post to be deleted

Returns
Type Description
\Zend_Service_Delicious Provides a fluent interface
methodpublicgetAllPosts( string $tag = null ) : \Zend_Service_Delicious_PostList

Get all posts

Parameters
Name Type Description
$tag string

Optional filtering by tag

Returns
Type Description
\Zend_Service_Delicious_PostList
methodpublicgetBundles( ) : array

Get all bundles, returning an array with bundles as keys and array of tags as values

Returns
Type Description
array list of bundles
methodpublicgetDates( string $tag = null ) : array

Get number of posts by date

Returns array where keys are dates and values are numbers of posts

Parameters
Name Type Description
$tag string

Optional filtering by tag

Returns
Type Description
array list of dates
methodpublicgetLastUpdate( ) : \Zend_Date

Get time of the last update

Returns
Type Description
\Zend_Date
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodpublicgetPosts( string $tag = null, \Zend_Date $dt = null, string $url = null ) : \Zend_Service_Delicious_PostList

Get posts matching the arguments

If no date or url is given, most recent date will be used

Parameters
Name Type Description
$tag string

Optional filtering by tag

$dt \Zend_Date

Optional filtering by date

$url string

Optional filtering by url

Returns
Type Description
\Zend_Service_Delicious_PostList
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodpublicgetRecentPosts( string $tag = null, string $count = 15 ) : \Zend_Service_Delicious_PostList

Get recent posts

Parameters
Name Type Description
$tag string

Optional filtering by tag

$count string

Maximum number of posts to be returned (default 15)

Returns
Type Description
\Zend_Service_Delicious_PostList
methodpublicgetTags( ) : array

Get all tags, returning an array with tags as keys and number of corresponding posts as values

Returns
Type Description
array list of tags
methodpublicgetUrlDetails( string $url ) : array

Get details on a particular bookmarked URL

Returned array contains four elements: - hash - md5 hash of URL - top_tags - array of tags and their respective usage counts - url - URL for which details were returned - total_posts - number of users that have bookmarked URL

If URL hasen't been bookmarked null is returned.

Parameters
Name Type Description
$url string

URL for which to get details

Returns
Type Description
array
methodpublicgetUserFans( string $user ) : array

Get fans of a user

Parameters
Name Type Description
$user string

Owner of the fans

Returns
Type Description
array
methodpublicgetUserNetwork( string $user ) : array

Get network of a user

Parameters
Name Type Description
$user string

Owner of the network

Returns
Type Description
array
methodpublicgetUserPosts( string $user, int $count = null, string $tag = null ) : \Zend_Service_Delicious_PostList

Get posts of a user

Parameters
Name Type Description
$user string

Owner of the posts

$count int

Number of posts (default 15, max. 100)

$tag string

Optional filtering by tag

Returns
Type Description
\Zend_Service_Delicious_PostList
methodpublicgetUserTags( string $user, int $atleast = null, int $count = null, string $sort = 'alpha' ) : array

Get tags of a user

Returned array has tags as keys and number of posts as values

Parameters
Name Type Description
$user string

Owner of the posts

$atleast int

Include only tags for which there are at least ### number of posts

$count int

Number of tags to get (default all)

$sort string

Order of returned tags ('alpha' || 'count')

Returns
Type Description
array
methodpublicmakeRequest( string $path, array $parms = array(), string $type = 'xml' ) : mixed

Handles all GET requests to a web service

Parameters
Name Type Description
$path string

Path

$parms array

Array of GET parameters

$type string

Type of a request ("xml"|"json")

Returns
Type Description
mixed decoded response from web service
Throws
Exception Description
\Zend_Service_Delicious_Exception
methodpublicrenameTag( string $old, string $new ) : \Zend_Service_Delicious

Rename a tag

Parameters
Name Type Description
$old string

Old tag name

$new string

New tag name

Returns
Type Description
\Zend_Service_Delicious Provides a fluent interface
methodpublicsetAuth( string $uname, string $pass ) : \Zend_Service_Delicious

Set client username and password

Parameters
Name Type Description
$uname string

Client user name

$pass string

Client password

Returns
Type Description
\Zend_Service_Delicious Provides a fluent interface
Documentation was generated by DocBlox 0.15.1.