PHP Class PinboardAPI

URL: http://github.com/kijin/pinboard-api Version: 0.3.2 Copyright (c) 2012-2016, Kijin Sung Copyright (c) 2014, Erin Dalzell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Show file Open project: kijin/pinboard-api Class Usage Examples

Public Properties

Property Type Description
$_instance_hashes

Protected Properties

Property Type Description
$_connection_timeout
$_curl_handle
$_instance_hash
$_last_status
$_logging_callback
$_pass
$_request_timeout
$_user

Public Methods

Method Description
__construct ( $user, $pass, $connection_timeout = 10, $request_timeout = 30 ) Constructor.
__destruct ( ) Destructor.
delete ( $bookmark ) Delete a bookmark.
delete_tag ( $tag ) Delete a tag.
dump ( ) Dump all your bookmarks in an importable format.
enable_logging ( $func ) Enable logging to a user-specified function.
get ( $url = null, $tags = null, $date = null ) Get some bookmarks.
get_all ( $count = null, $offset = null, $tags = null, $from = null, $to = null ) Get all bookmarks.
get_api_token ( ) Get the user's API token.
get_dates ( $tags = null ) Get dates.
get_last_status ( ) Get the last status code.
get_note ( $id ) Get a single note.
get_recent ( $count = 15, $tags = null ) Get recent bookmarks.
get_rss_token ( ) Get the user's secret RSS token.
get_suggested_tags ( $bookmark ) Get tag suggestions for a bookmark.
get_tags ( ) Get all tags.
get_updated_time ( ) Call this before get_all() to check for updates.
list_notes ( ) Get the list of notes.
rename_tag ( $old, $new ) Rename a tag.
save ( $bookmark, $replace = true ) Save a new bookmark. (This include both adding and editing.)
search_by_date ( $date )
search_by_interval ( $from, $to )
search_by_tag ( $tags )
search_by_url ( $url ) Some shortcuts to the above.

Protected Methods

Method Description
_json_to_bookmark ( $json ) This method builds a PinboardBookmark object from an XML element.
_json_to_note ( $json ) This method builds a PinboardNote object from an XML element.
_json_to_status ( $json ) This method translates XML responses into boolean status codes.
_normalize_tags ( $tags ) Normalize tags.
_remote ( $method, $args = [], $use_json = true ) This method handles all remote method calls.
_to_datetime ( $timestamp ) This method translates timestamps into Pinboard API's datetime format.

Method Details

__construct() public method

Constructor.
public __construct ( $user, $pass, $connection_timeout = 10, $request_timeout = 30 )

__destruct() public method

Destructor.
public __destruct ( )

_json_to_bookmark() protected method

This method builds a PinboardBookmark object from an XML element.
protected _json_to_bookmark ( $json )

_json_to_note() protected method

This method builds a PinboardNote object from an XML element.
protected _json_to_note ( $json )

_json_to_status() protected method

This method translates XML responses into boolean status codes.
protected _json_to_status ( $json )

_normalize_tags() protected method

Normalize tags.
protected _normalize_tags ( $tags )

_remote() protected method

This method handles all remote method calls.
protected _remote ( $method, $args = [], $use_json = true )

_to_datetime() protected method

This method translates timestamps into Pinboard API's datetime format.
protected _to_datetime ( $timestamp )

delete() public method

Delete a bookmark.
public delete ( $bookmark )

delete_tag() public method

Delete a tag.
public delete_tag ( $tag )

dump() public method

Dump all your bookmarks in an importable format.
public dump ( )

enable_logging() public method

Enable logging to a user-specified function.
public enable_logging ( $func )

get() public method

Get some bookmarks.
public get ( $url = null, $tags = null, $date = null )

get_all() public method

Get all bookmarks.
public get_all ( $count = null, $offset = null, $tags = null, $from = null, $to = null )

get_api_token() public method

Get the user's API token.
public get_api_token ( )

get_dates() public method

Get dates.
public get_dates ( $tags = null )

get_last_status() public method

Get the last status code.
public get_last_status ( )

get_note() public method

Get a single note.
public get_note ( $id )

get_recent() public method

Get recent bookmarks.
public get_recent ( $count = 15, $tags = null )

get_rss_token() public method

Get the user's secret RSS token.
public get_rss_token ( )

get_suggested_tags() public method

Get tag suggestions for a bookmark.
public get_suggested_tags ( $bookmark )

get_tags() public method

Get all tags.
public get_tags ( )

get_updated_time() public method

Call this before get_all() to check for updates.
public get_updated_time ( )

list_notes() public method

Get the list of notes.
public list_notes ( )

rename_tag() public method

Rename a tag.
public rename_tag ( $old, $new )

save() public method

Save a new bookmark. (This include both adding and editing.)
public save ( $bookmark, $replace = true )

search_by_date() public method

public search_by_date ( $date )

search_by_interval() public method

public search_by_interval ( $from, $to )

search_by_tag() public method

public search_by_tag ( $tags )

search_by_url() public method

Some shortcuts to the above.
public search_by_url ( $url )

Property Details

$_connection_timeout protected property

protected $_connection_timeout

$_curl_handle protected property

protected $_curl_handle

$_instance_hash protected property

protected $_instance_hash

$_instance_hashes public static property

public static $_instance_hashes

$_last_status protected property

protected $_last_status

$_logging_callback protected property

protected $_logging_callback

$_pass protected property

protected $_pass

$_request_timeout protected property

protected $_request_timeout

$_user protected property

protected $_user