Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergiopvilar/kindle-periodical
Php class that helps to build kindle periodicals
https://github.com/sergiopvilar/kindle-periodical
Last synced: about 1 month ago
JSON representation
Php class that helps to build kindle periodicals
- Host: GitHub
- URL: https://github.com/sergiopvilar/kindle-periodical
- Owner: sergiopvilar
- License: mit
- Created: 2013-07-20T11:10:03.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-27T05:10:56.000Z (over 10 years ago)
- Last Synced: 2024-04-17T03:50:45.461Z (9 months ago)
- Language: PHP
- Size: 204 KB
- Stars: 19
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kindle Periodical
=================Php class that helps to build kindle periodicals
**Important:** You need to add [KindleGen](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000765211) as a command to run KindlePeriodical
## Usage
**(Example can be found on example.php)**First you need to create an array with the content of the periodical:
$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:
$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();