hu.alphabox / packtub-crawler
a minimal library to download ebooks from packtub.com
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/hu.alphabox/packtub-crawler
Requires
- php: >=5.6
- monolog/monolog: ~1.23
This package is not auto-updated.
Last update: 2025-09-28 10:32:10 UTC
README
Introduction
packtub-crawler is a simple, minimalistic PHP library to crawl your ebooks from https://www.packtpub.com. You can list your available books, and download those in different formats with source code (if available).
Installation
Install the latest version with
$ composer require alphabox/packtub-crawler
Usage
A simple usage example to list your all available ebook.
<?php include_once __DIR__ . '/vendor/autoload.php'; use Alphabox\PacktubCrawler\PacktubSite; use Monolog\Logger; use Monolog\Handler\StreamHandler; $logger = new Logger('stdout'); $logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG)); //Login to Packtub site $logger->info("Login to packtub.com"); $packtub = new PacktubSite($logger); $packtub->login('user@example.com', "supersecretpassword"); $logger->info("Get and list available books."); foreach( $packtub->getAvailableBooks() as $title => $formats ) { $logger->info($title); } ?>
License
This project licensed under Apache 2.0 License - see the LICENSE file for details