Mathias Weidner > WebService-Leanpub-v0.1.0 > leanpub


Annotate this POD

View/Report Bugs
Source   Latest Release: WebService-Leanpub-v0.3.0


leanpub - access the Leanpub web API


 leanpub [options] command [command options]



Provide the Leanpub API key to be used for all actions.


Print a brief help message and exit.


Print the manual page and exit.


State that you really intend to do the command (e.g. publish).


Provide the book's slug.


Print $WebService::Leanpub::VERSION and exit.


individual_purchases [ -page=p ]

Retrieve data about individual purchases.

This command takes the option -page to set the page of the individual purchases report to be retrieved.


Retrieve the status of the last job.


Start a partial preview of your book using Preview.txt.


Start a preview of your book.

publish [ options ]

Publish your book.

You have to use option -really with this command.

This command takes the following command options:


Email readers, notifying them that the book has been updated.


The release notes to be included in the email to the readers.


Retrieve a summary of sales data.


This program interacts with the Leanpub API. See for details about this API.

The slug is the part of the URL for your book coming after For instance if your book is found at, then the slug for your book is your_book.



This program searches in the current working directory and all directories above for a text file named .leanpub.conf. It reads these files and adds configuration directives which are not set so far to its configuration.

The format of the file is rather simple. It just a key and a value separated by an equal sign and optional whitespace. Valid keys are the names of the global options without any minus or plus sign. For instance I have a file containing something like:

 # configuration for leanpub
 api_key = my_api_key_from_leanpub
 slug    = using-the-leanpub-api-with-perl

in the directory I am developing this module in. So I don't have to provide the options -api_key and -slug to test this script. When I use the script for more than one book, I place a file called .leanpub.conf containing the API key further up and have only the SLUG in the files located in the book directories. To use a different API key I would write it in the file in the book directory so that the one further up would not be used.


Mathias Weidner

syntax highlighting: