Service/Delicious.php
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-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_Service
- subpackage
- Delicious
- version
- $Id: Delicious.php 23775 2011-03-01 17:25:24Z ralph $
\Zend_Service_Delicious
Zend_Service_Delicious is a concrete implementation of the del.icio.us web service
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- license
-
New BSD License
- package
- Zend_Service
- subpackage
- Delicious
Constants
Properties



float
$_lastRequestTime= '0'
staticMicrotime of last request
Default value0
Details
- Type
- float



\Zend_Service_Rest
$_rest= ''
Zend_Service_Rest instance
Details
- Type
- \Zend_Service_Rest
Methods



__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 |



_xmlResponseToArray(
\DOMDocument $response, string $root, string $child, string $attKey, string $attValue
)
:
array
staticTransform 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
Throws



getBundles(
)
:
array
Get all bundles, returning an array with bundles as keys and array of tags as values
Returns
Type |
Description |
array |
list of bundles |



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



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
Parameters
Name |
Type |
Description |
$tag |
string |
Optional filtering by tag |
$dt |
\Zend_Date |
Optional filtering by date |
$url |
string |
Optional filtering by url |
Returns
Throws



getRecentPosts(
string $tag
=
null, string $count
=
15
)
:
\Zend_Service_Delicious_PostList
Parameters
Name |
Type |
Description |
$tag |
string |
Optional filtering by tag |
$count |
string |
Maximum number of posts to be returned (default 15)
|
Returns



getTags(
)
:
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 |



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.
Parameters
Name |
Type |
Description |
$url |
string |
URL for which to get details |
Returns



getUserPosts(
string $user, int $count
=
null, string $tag
=
null
)
:
\Zend_Service_Delicious_PostList
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



getUserTags(
string $user, int $atleast
=
null, int $count
=
null, string $sort
=
alpha
)
:
array
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



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



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