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

category Zend
package Zend_Service
subpackage Delicious
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructs a new del.icio.us Web Services Client

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

Parameters

$uname

string

Client username

$pass

string

Client password

Adds a new bundle

addBundle(string $bundle, array $tags) : \Zend_Service_Delicious

Parameters

$bundle

string

Name of new bundle

$tags

array

Array of tags

Returns

\Zend_Service_DeliciousProvides a fluent interface

Create new post

createNewPost($title, $url) : \Zend_Service_Delicious_Post

Parameters

$title

$url

Returns

\Zend_Service_Delicious_Post

Delete a bundle

deleteBundle(string $bundle) : \Zend_Service_Delicious

Parameters

$bundle

string

Name of bundle to be deleted

Returns

\Zend_Service_DeliciousProvides a fluent interface

Delete a post

deletePost(string $url) : \Zend_Service_Delicious

Parameters

$url

string

URL of post to be deleted

Returns

\Zend_Service_DeliciousProvides a fluent interface

Get all posts

getAllPosts(string $tag = null) : \Zend_Service_Delicious_PostList

Parameters

$tag

string

Optional filtering by tag

Returns

\Zend_Service_Delicious_PostList

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

getBundles() : array

Returns

arraylist of bundles

Get number of posts by date

getDates(string $tag = null) : array

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

Parameters

$tag

string

Optional filtering by tag

Returns

arraylist of dates

Get time of the last update

getLastUpdate() : \Zend_Date

Exceptions

\Zend_Service_Delicious_Exception

Returns

\Zend_Date

Get posts matching the arguments

getPosts(string $tag = null, \Zend_Date $dt = null, string $url = null) : \Zend_Service_Delicious_PostList

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

Parameters

$tag

string

Optional filtering by tag

$dt

\Zend_Date

Optional filtering by date

$url

string

Optional filtering by url

Exceptions

\Zend_Service_Delicious_Exception

Returns

\Zend_Service_Delicious_PostList

Get recent posts

getRecentPosts(string $tag = null, string $count = 15) : \Zend_Service_Delicious_PostList

Parameters

$tag

string

Optional filtering by tag

$count

string

Maximum number of posts to be returned (default 15)

Returns

\Zend_Service_Delicious_PostList

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

getTags() : array

Returns

arraylist of tags

Get details on a particular bookmarked URL

getUrlDetails(string $url) : array

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

$url

string

URL for which to get details

Returns

array

Get fans of a user

getUserFans(string $user) : array

Parameters

$user

string

Owner of the fans

Returns

array

Get network of a user

getUserNetwork(string $user) : array

Parameters

$user

string

Owner of the network

Returns

array

Get posts of a user

getUserPosts(string $user, integer $count = null, string $tag = null) : \Zend_Service_Delicious_PostList

Parameters

$user

string

Owner of the posts

$count

integer

Number of posts (default 15, max. 100)

$tag

string

Optional filtering by tag

Returns

\Zend_Service_Delicious_PostList

Get tags of a user

getUserTags(string $user, integer $atleast = null, integer $count = null, string $sort = 'alpha') : array

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

Parameters

$user

string

Owner of the posts

$atleast

integer

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

$count

integer

Number of tags to get (default all)

$sort

string

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

Returns

array

Handles all GET requests to a web service

makeRequest(string $path, array $parms = array(), string $type = 'xml') : mixed

Parameters

$path

string

Path

$parms

array

Array of GET parameters

$type

string

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

Exceptions

\Zend_Service_Delicious_Exception

Returns

mixeddecoded response from web service

Rename a tag

renameTag(string $old, string $new) : \Zend_Service_Delicious

Parameters

$old

string

Old tag name

$new

string

New tag name

Returns

\Zend_Service_DeliciousProvides a fluent interface

Set client username and password

setAuth(string $uname, string $pass) : \Zend_Service_Delicious

Parameters

$uname

string

Client user name

$pass

string

Client password

Returns

\Zend_Service_DeliciousProvides a fluent interface

Evaluates XML response

_evalXmlResult(\DOMDocument $response) : void
Static

Parameters

$response

\DOMDocument

Exceptions

\Zend_Service_Delicious_Exception

Constructs Zend_Service_Delicious_PostList from XML response

_parseXmlPostList(\DOMDocument $response) : \Zend_Service_Delicious_PostList

Parameters

$response

\DOMDocument

Exceptions

\Zend_Service_Delicious_Exception

Returns

\Zend_Service_Delicious_PostList

Transform XML string to array

_xmlResponseToArray(\DOMDocument $response, string $root, string $child, string $attKey, string $attValue) : array
Static

Parameters

$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

Exceptions

\Zend_Service_Delicious_Exception

Returns

array

 Properties

 

Password

$_authPass : string

Default

 

Username

$_authUname : string

Default

 

Microtime of last request

$_lastRequestTime : float

Default

0
Static
 

Zend_Service_Rest instance

$_rest : \Zend_Service_Rest

Default

 Constants

 

API_URI

API_URI = 'https://api.del.icio.us' 
 

JSON_FANS

JSON_FANS = '/feeds/json/fans/%s' 
 

JSON_NETWORK

JSON_NETWORK = '/feeds/json/network/%s' 
 

JSON_POSTS

JSON_POSTS = '/feeds/json/%s/%s' 
 

JSON_TAGS

JSON_TAGS = '/feeds/json/tags/%s' 
 

JSON_URI

JSON_URI = 'http://del.icio.us' 
 

JSON_URL

JSON_URL = '/feeds/json/url/data' 
 

PATH_BUNDLES

PATH_BUNDLES = '/v1/tags/bundles/all' 
 

PATH_BUNDLE_ADD

PATH_BUNDLE_ADD = '/v1/tags/bundles/set' 
 

PATH_BUNDLE_DELETE

PATH_BUNDLE_DELETE = '/v1/tags/bundles/delete' 
 

PATH_DATES

PATH_DATES = '/v1/posts/dates' 
 

PATH_POSTS_ADD

PATH_POSTS_ADD = '/v1/posts/add' 
 

PATH_POSTS_ALL

PATH_POSTS_ALL = '/v1/posts/all' 
 

PATH_POSTS_GET

PATH_POSTS_GET = '/v1/posts/get' 
 

PATH_POSTS_RECENT

PATH_POSTS_RECENT = '/v1/posts/recent' 
 

PATH_POST_DELETE

PATH_POST_DELETE = '/v1/posts/delete' 
 

PATH_TAGS

PATH_TAGS = '/v1/tags/get' 
 

PATH_TAG_RENAME

PATH_TAG_RENAME = '/v1/tags/rename' 
 

PATH_UPDATE

PATH_UPDATE = '/v1/posts/update'