Services_Scribd
[ class tree: Services_Scribd ] [ index: Services_Scribd ] [ all elements ]

Class: Services_Scribd_Docs

Source Location: /Services_Scribd-0.2.0/Services/Scribd/Docs.php

Class Overview

Services_Scribd
   |
   --Services_Scribd_Common
      |
      --Services_Scribd_Docs

The interface for the "docs" API endpoint. Provides all interaction that is associated with a specific document or several documents, such as uploading, editing, etc.


Author(s):

Copyright:

  • 2009 Rich Schumacher <rich.schu@gmail.com>

Variables

Methods


Inherited Variables

Inherited Methods

Class: Services_Scribd_Common

Services_Scribd_Common::__construct()
Prevents calls from bubbling up to Serices_Scribd::_construct()
Services_Scribd_Common::call()
Builds, sends, and returns the response for an API request
Services_Scribd_Common::getAvailableEndpoints()
Returns an array of endpoints for this driver
Services_Scribd_Common::sendRequest()
Sends the request to the Scribd API
Services_Scribd_Common::setRequestAdapter()
Sets the request adapter to use for this request
Services_Scribd_Common::__call()
Traps any requests to endpoints that are not defined

Class: Services_Scribd

Services_Scribd::__construct()
Sets the API key and optional API secret
Services_Scribd::getAccount()
Returns the current account instance
Services_Scribd::setAccount()
Sets the Scribd account to use
Services_Scribd::__get()
Loads individual endpoint drivers

Class Details

[line 36]
The interface for the "docs" API endpoint. Provides all interaction that is associated with a specific document or several documents, such as uploading, editing, etc.


[ Top ]


Class Variables

$validEndpoints = array(
        'browse',
        'changeSettings',
        'delete',
        'featured',
        'getCategories',
        'getConversionStatus',
        'getDownloadUrl',
        'getList',
        'getSettings',
        'getStats',
        'search',
        'upload',
        'uploadFromUrl',
        'uploadThumb',
    )

[line 43]

Array of API endpoints that are supported
  • Access: protected

Type:   array


[ Top ]



Method Detail

browse   [line 92]

SimpleXMLElement browse( [integer $limit = 20], [integer $offset = 1], [integer $categoryId = null], [string $sort = 'popular'])

Returns a list of documents that meet filter criteria

Parameters:

integer   $limit     Number of results to return
integer   $offset     Number to start at
integer   $categoryId     A category ID to search documents in
string   $sort     Sort order, options are popular, views, newest

[ Top ]

changeSettings   [line 117]

true changeSettings( $docIds, $settings)

Changes metadata for one or many documents

Parameters:

array   $docIds     Array of document ids to modify
array   $settings     Associative array of values to use

[ Top ]

delete   [line 157]

true delete( integer $docId)

Deletes a document

Parameters:

integer   $docId     The id of the document to delete

[ Top ]

featured   [line 176]

SimpleXMLElement featured( [integer $limit = 20], [integer $offset = 0], [string $scope = "hot"])

Return a list of featured documents
  • Access: public

Parameters:

integer   $limit     Max amount of results to return
integer   $offset     Offset into the list of documents
string   $scope     Whether to search new documents or hot only. Valid scopes are "hot" and "new".

[ Top ]

getCategories   [line 197]

SimpleXMLElement getCategories( [integer $categoryId = null], [boolean $withSubcategories = true])

Fetch a list of categories

Parameters:

integer   $categoryId     The ID of category to retrieve children for. If none - all root categories will be returned.
boolean   $withSubcategories     Include subcategories in results

[ Top ]

getConversionStatus   [line 218]

string getConversionStatus( integer $docId)

Retrieves the conversion status of a document

Parameters:

integer   $docId     The id of document to check

[ Top ]

getDownloadUrl   [line 237]

string getDownloadUrl( integer $docId, [string $docType = 'original'])

Gets a download URL for a particular document

Parameters:

integer   $docId     The id of the document
string   $docType     The format of the document

[ Top ]

getList   [line 264]

array getList( [integer $limit = 10], [integer $offset = 0], [boolean $useAPIAccount = false])

Revtrieves a list of documents owned by a user

Parameters:

integer   $limit     Max amount of results to return
integer   $offset     Offset into the list of documents
boolean   $useAPIAccount     Show documents associated with the API account, rather the Scribd user account

[ Top ]

getSettings   [line 284]

SimpleXMLElement getSettings( integer $docId)

Gets metadata about a particular document

Parameters:

integer   $docId     The id of the document

[ Top ]

getStats   [line 299]

SimpleXMLElement getStats( integer $docId)

Retrieves statistics of a document

Parameters:

integer   $docId     The id of the document

[ Top ]

search   [line 321]

SimpleXMLElement search( string $query, [integer $limit = 10], [integer $offset = 1], [integer $categoryId = null], [string $language = null], [boolean $simple = true])

Searches for the text string within Scribd documents

Parameters:

string   $query     The text to search for
integer   $limit     The max number of results to return
integer   $offset     The number to start at
integer   $categoryId     Restricts search results to this category
string   $language     Restrict search results to this language (ISO 639-1 format)
boolean   $simple     Use advanced search queries

[ Top ]

upload   [line 352]

SimpleXMLElement upload( string $filepath, string $docType, [string $access = 'public'], [integer $paidContent = 0], [integer $revisionId = null])

Uploads and publishes a document from the filesystem

Parameters:

string   $filepath     A path to the file we want to upload
string   $docType     The type of document
string   $access     Document Access {public, private}
integer   $paidContent     Is this paid content? {0,1}
integer   $revisionId     The document id we are revising

[ Top ]

uploadFromUrl   [line 393]

SimpleXMLElement uploadFromUrl( string $url, string $docType, [string $access = 'public'], [integer $paidContent = 0], [integer $revisionId = null])

Uploads and publishes a document from a URL

Parameters:

string   $url     The URL where the file is located
string   $docType     The type of document
string   $access     Document Access {public, private}
integer   $paidContent     Is this paid content? {0,1}
integer   $revisionId     The document id we are revising

[ Top ]

uploadThumb   [line 427]

boolean uploadThumb( string $filepath, string $docId)

XXX: This doesn't appear to be working; throwing 500's consistently.

Uploads a thumbnail for a document


Parameters:

string   $filepath     A path to the thumbnail we want to upload
string   $docId     The id of the document

[ Top ]


Documentation generated on Sat, 06 Apr 2013 14:30:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.