API Documentation

Service/Delicious.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Delicious
version
$Id: Delicious.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Service_Delicious

Description

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.

Zend_Service_Delicious

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Delicious
Constants
API_URI
PATH_UPDATE
PATH_TAGS
PATH_TAG_RENAME
PATH_BUNDLES
PATH_BUNDLE_DELETE
PATH_BUNDLE_ADD
PATH_DATES
PATH_POST_DELETE
PATH_POSTS_GET
PATH_POSTS_ALL
PATH_POSTS_ADD
PATH_POSTS_RECENT
JSON_URI
JSON_POSTS
JSON_TAGS
JSON_NETWORK
JSON_FANS
JSON_URL
Properties
$_rest
$_authUname
$_authPass
$_lastRequestTime
Methods
__construct
setAuth
getLastUpdate
getTags
renameTag
getBundles
addBundle
deleteBundle
deletePost
getDates
getPosts
getAllPosts
getRecentPosts
createNewPost
getUserPosts
getUserTags
getUserNetwork
getUserFans
getUrlDetails
makeRequest
_xmlResponseToArray
_parseXmlPostList
_evalXmlResult

Description

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

Constants

API_URI

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

Details

value
https://api.del.icio.us

PATH_UPDATE

 PATH_UPDATE = '/v1/posts/update'

Details

value
/v1/posts/update

PATH_TAGS

 PATH_TAGS = '/v1/tags/get'

Details

value
/v1/tags/get

PATH_TAG_RENAME

 PATH_TAG_RENAME = '/v1/tags/rename'

Details

value
/v1/tags/rename

PATH_BUNDLES

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

Details

value
/v1/tags/bundles/all

PATH_BUNDLE_DELETE

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

Details

value
/v1/tags/bundles/delete

PATH_BUNDLE_ADD

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

Details

value
/v1/tags/bundles/set

PATH_DATES

 PATH_DATES = '/v1/posts/dates'

Details

value
/v1/posts/dates

PATH_POST_DELETE

 PATH_POST_DELETE = '/v1/posts/delete'

Details

value
/v1/posts/delete

PATH_POSTS_GET

 PATH_POSTS_GET = '/v1/posts/get'

Details

value
/v1/posts/get

PATH_POSTS_ALL

 PATH_POSTS_ALL = '/v1/posts/all'

Details

value
/v1/posts/all

PATH_POSTS_ADD

 PATH_POSTS_ADD = '/v1/posts/add'

Details

value
/v1/posts/add

PATH_POSTS_RECENT

 PATH_POSTS_RECENT = '/v1/posts/recent'

Details

value
/v1/posts/recent

JSON_URI

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

Details

value
http://del.icio.us

JSON_POSTS

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

Details

value
/feeds/json/%s/%s

JSON_TAGS

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

Details

value
/feeds/json/tags/%s

JSON_NETWORK

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

Details

value
/feeds/json/network/%s

JSON_FANS

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

Details

value
/feeds/json/fans/%s

JSON_URL

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

Details

value
/feeds/json/url/data

Properties

$_authPass

string $_authPass = ''

Password

Details

$_authPass
string
visibility
protected
default
final
false
static
false

$_authUname

string $_authUname = ''

Username

Details

$_authUname
string
visibility
protected
default
final
false
static
false

$_lastRequestTime

float $_lastRequestTime = '0'

Microtime of last request

Details

$_lastRequestTime
float
visibility
protected
default
0
final
false
static
true

$_rest

Zend_Service_Rest $_rest = ''

Zend_Service_Rest instance

Details

$_rest
Zend_Service_Rest
visibility
protected
default
final
false
static
false

Methods

__construct

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

Constructs a new del.icio.us Web Services Client

Arguments
$uname
string
Client username
$pass
string
Client password
Details
visibility
public
final
false
static
false

_evalXmlResult

_evalXmlResult( DOMDocument $response ) : void

Evaluates XML response

Arguments
$response
DOMDocument
Details
visibility
private
final
false
static
true
throws

_parseXmlPostList

_parseXmlPostList( DOMDocument $response ) : Zend_Service_Delicious_PostList

Constructs Zend_Service_Delicious_PostList from XML response

Arguments
$response
DOMDocument
Details
visibility
private
final
false
static
false
throws

_xmlResponseToArray

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

Transform XML string to array

Arguments
$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
Output
array
Details
visibility
private
final
false
static
true
throws

addBundle

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

Adds a new bundle

Arguments
$bundle
string
Name of new bundle
$tags
array
Array of tags
Output
Zend_Service_Delicious
Provides a fluent interface
Details
visibility
public
final
false
static
false

createNewPost

createNewPost(  $title,  $url ) : Zend_Service_Delicious_Post

Create new post

Arguments
$title
$url
Details
visibility
public
final
false
static
false

deleteBundle

deleteBundle( string $bundle ) : Zend_Service_Delicious

Delete a bundle

Arguments
$bundle
string
Name of bundle to be deleted
Output
Zend_Service_Delicious
Provides a fluent interface
Details
visibility
public
final
false
static
false

deletePost

deletePost( string $url ) : Zend_Service_Delicious

Delete a post

Arguments
$url
string
URL of post to be deleted
Output
Zend_Service_Delicious
Provides a fluent interface
Details
visibility
public
final
false
static
false

getAllPosts

getAllPosts( string $tag = null ) : Zend_Service_Delicious_PostList

Get all posts

Arguments
$tag
string
Optional filtering by tag
Details
visibility
public
final
false
static
false

getBundles

getBundles( ) : array

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

Output
array
list of bundles
Details
visibility
public
final
false
static
false

getDates

getDates( string $tag = null ) : array

Get number of posts by date

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

Arguments
$tag
string
Optional filtering by tag
Output
array
list of dates
Details
visibility
public
final
false
static
false

getLastUpdate

getLastUpdate( ) : Zend_Date

Get time of the last update

Output
Zend_Date
Details
visibility
public
final
false
static
false
throws

getPosts

getPosts( 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

Arguments
$tag
string
Optional filtering by tag
$dt
Zend_Date
Optional filtering by date
$url
string
Optional filtering by url
Details
visibility
public
final
false
static
false
throws

getRecentPosts

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

Get recent posts

Arguments
$tag
string
Optional filtering by tag
$count
string
Maximum number of posts to be returned (default 15)
Details
visibility
public
final
false
static
false

getTags

getTags( ) : array

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

Output
array
list of tags
Details
visibility
public
final
false
static
false

getUrlDetails

getUrlDetails( 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.

Arguments
$url
string
URL for which to get details
Output
array
Details
visibility
public
final
false
static
false

getUserFans

getUserFans( string $user ) : array

Get fans of a user

Arguments
$user
string
Owner of the fans
Output
array
Details
visibility
public
final
false
static
false

getUserNetwork

getUserNetwork( string $user ) : array

Get network of a user

Arguments
$user
string
Owner of the network
Output
array
Details
visibility
public
final
false
static
false

getUserPosts

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

Get posts of a user

Arguments
$user
string
Owner of the posts
$count
int
Number of posts (default 15, max. 100)
$tag
string
Optional filtering by tag
Details
visibility
public
final
false
static
false

getUserTags

getUserTags( 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

Arguments
$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')
Output
array
Details
visibility
public
final
false
static
false

makeRequest

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

Handles all GET requests to a web service

Arguments
$path
string
Path
$parms
array
Array of GET parameters
$type
string
Type of a request ("xml"|"json")
Output
mixed
decoded response from web service
Details
visibility
public
final
false
static
false
throws

renameTag

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

Rename a tag

Arguments
$old
string
Old tag name
$new
string
New tag name
Output
Zend_Service_Delicious
Provides a fluent interface
Details
visibility
public
final
false
static
false

setAuth

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

Set client username and password

Arguments
$uname
string
Client user name
$pass
string
Client password
Output
Zend_Service_Delicious
Provides a fluent interface
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.