Horde_Service_Scribd::getSettings PHP Method

getSettings() public method

Get a document's settings
public getSettings ( integer $docId ) : array
$docId integer Document id to get status for
return array [doc_id, title, description, access, license, tags[], show_ads, access_key, thumbnail_url, secret_password]
    public function getSettings($docId)
    {
        $response = $this->newRequest('docs.getSettings', array('doc_id' => $docId))->run();
        return array('doc_id' => $response->doc_id(), 'title' => $response->title(), 'description' => $response->description(), 'access' => $response->access(), 'license' => $response->license(), 'tags' => strpos($response->tags(), ',') !== false ? explode(',', $response->tags()) : array(), 'show_ads' => $response->show_ads(), 'access_key' => $response->access_key(), 'thumbnail_url' => $response->thumbnail_url(), 'secret_password' => $response->secret_password());
    }

Usage Example

Example #1
0
<?php

/**
 * http://www.scribd.com/platform/documentation/api?method_name=Authentication
 * http://www.scribd.com/platform/account
 *
 */
error_reporting(E_ALL);
require 'Horde/Autoloader.php';
$scribd = new Horde_Service_Scribd(array('api_key' => '', 'api_secret' => ''));
foreach ($scribd->getList() as $doc) {
    echo $doc->doc_id . ': ' . $doc->title . "\n";
    $doc_id = $doc->doc_id();
}
var_dump($scribd->getConversionStatus($doc_id));
var_dump($scribd->getSettings($doc_id));
if (false) {
    /**
     * Upload a document from a file
    */
    $file = '../testfile.txt';
    //a reference to the file in reference to the current working directory.
    $doc_type = null;
    $access = null;
    $rev_id = null;
    // $data = $scribd->upload($file, $doc_type, $access, $rev_id); // returns Array ( [doc_id] => 1026598 [access_key] => key-23nvikunhtextwmdjm2i )
    /**
     * Upload a document from a URL
    */
    $scribd->my_user_id = '143';
    # The user ID of one of your users