2017 © Pedro Peláez
 

library kindle-periodical

Php class that helps to build kindle periodicals

image

sergiovilar/kindle-periodical

Php class that helps to build kindle periodicals

  • Sunday, July 27, 2014
  • by sergiovilar
  • Repository
  • 4 Watchers
  • 18 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Kindle Periodical

Php class that helps to build kindle periodicals, (*1)

Important: You need to add KindleGen as a command to run KindlePeriodical, (*2)

Usage

(Example can be found on example.php), (*3)

First you need to create an array with the content of the periodical:, (*4)

$content = array(

    // Array of sections
    array(
        'id' => '0',
        'name' => 'My first section',
        'content' => array(

            // Array of articles
            array(
                'title' => 'Title of my first article',
                'content' => 'content of my article' // HTML is allowed
            )
        )
    ),

    array(
        'id' => '1',
        'name' => 'My toher section',
        'content' => array(

            // Array of articles
            array(
                'title' => 'Title of my other article',
                'content' => 'content of my article'
            )
        )
    )


);

With this, you can now generate your .mobi file with KindlePeriodical:, (*5)

 $ebook = new \Kindle\Periodical(array(

    "outputFolder" => "out",

    // Optional arguments:
    "shell" => false, // KindlePeriodical will use exec instead of shell_exec
    "debug" => true

));

$ebook->setMeta(array(
    'title' => 'My Kindle Periodical',
    'creator' => "sergiovilar",
    'publisher' => "sergiovilar",
    'subject' => 'Sample Periodical',
    'description' => 'Set of articles in one .mobi file'
));

// Generates the file
$content = $ebook->setContent($content);

// Return the file name
$file = $ebook->getFilename();

// Download the file
$ebook->downloadFile();

// Remove the file and directory
$ebook->deleteFile();

The Versions

27/07 2014

dev-master

9999999-dev

Php class that helps to build kindle periodicals

  Sources   Download

MIT

The Requires

 

by Sergio Vilar