siegsb/play-extractor
Composer 安装命令:
composer require siegsb/play-extractor
包简介
Extracts info from Play Store easily like an API
README 文档
README
This project is a fork of PlayStoreApi project but isn't related in any way with that project. Thanks to RedInput, developer of the original library on which this is based.
Play Extractor provides a Composer PHP library to extract info from Play Store for differents items like albums, apps, artists and more.
Don't requires any kind of authentication and support all the languages and countries availables on Play Store website.
Installation
The best method to install PlayExtractor in your PHP project is using Composer, just add the following line to your require:
"siegsb/play-extractor": "1.0.*"
Then update your Composer project using composer update. Also you can clone this repository to your project path but the recomended method is via Composer.
Usage
First include the autoload.php file into your PHP script and set the namespace to use:
require_once __DIR__ . '/vendor/autoload.php'; use \SiegSB\PlayExtractor;
Then you can create a new PlayExtractor object with the locale and country params using ISO-2 format:
$playExtractor = new PlayExtractor('en', 'US');
Now you can request the details of any kind of content available on Play Store:
/** * @param $contentId string. The unique ID for the content, see the Supported Contents to more information * @return $details DataObject. The details of the content as a object of the requested content, see the Supported Contents to more information */ $playExtractor->details->album($contentId); $playExtractor->details->app($contentId); $playExtractor->details->artist($contentId); $playExtractor->details->book($contentId);
Supported Contents
Right now PlayExtractor support the following contents, in each item you can see more information:
Album
This object have the following methods:
// Returns the album ID, the same that you use when you call $playExtractor->details->album() $album->getAlbumId(); // Returns the URL of the album cover $album->getImage(); // Returns the title of the album $album->getTitle(); // Returns the artist name $album->getArtist(); // Returns the artist ID, you can use it to request the artist details $album->getArtistId(); // Returns the price based on your PlayExtractor language and country configuration $album->getPrice(); // Returns the Play Store URL of the album $album->getUrl(); // Returns the description of the album $album->getDescription(); // Returns the genre $album->getGenre(); // Returns the number of tracks $album->getTracks(); // Returns the total rating of the album as a float $album->getRatingValue(); // Returns the number of ratings $album->getRatingCount();
App
This object have the following methods:
// Returns the package name, this is the contentId $app->getPackage(); // Returns the URL of the icon like PNG $app->getIcon(); // Returns the public name of the app $app->getName(); // Returns the public name of the developer $app->getDeveloper(); // Returns the price of the app based in your PlayExtractor configuration $app->getPrice(); // Returns the Play Store URL of the app $app->getUrl(); // Returns the app description $app->getDescription(); // Returns the category $app->getCategory(); // Returns the total rating of the app as a float $app->getRatingValue(); // Returns the number of ratings $app->getRatingCount(); // Returns the size of the APK file $app->getFileSize(); // Returns the date of the last update as a string date format $app->getDateUpdated(); // Returns the number of downloads $app->getNumDownloads(); // Returns the current app version $app->getVersion(); // Returns the minimum Android version that the app requires $app->getRequiredAndroid(); // Returns the content rating $app->getContentRating(); // Returns the features of the app, e.g. if have ads or in-app purchases. // returns an array. $app->getFeatures(); // Returns the values for the in-app purchases if apply. $app->getInAppPrices();
Artist
This object have the following methods:
// Returns the artist ID $artist->getArtistId(); // Returns the URL of the artist image as PNG $artist->getImage(); // Returns the public artist name $artist->getName(); // Returns the Play Store URL of the artist $artist->getUrl(); // Returns the biography of the artist $artist->getAbout();
Book
This object have the following methods:
// Returns the book ID $book->getBookId(); // Returns the URL of the book cover as PNG $book->getImage(); // Returns the title $book->getTitle(); // Returns the public author name $book->getAuthor(); // Returns the price $book->getPrice(); // Returns the Play Store URL of the book $book->getUrl(); // Returns the description of the book $book->getDescription(); // Returns the total number of pages $book->getPages(); // Returns the language of the book $book->getLanguages(); // Returns the ISBN code $book->getIsbn(); // Returns the total rating as a float $book->getRatingValue(); // Returns the number of ratings $book->getRatingCount();
Exceptions
If the language or country code is not valid for Play Store, or if the requested content do not exist, PlayExtractor returns an Exception.
Tips
You can use the method json_encode() with any Data object to convert to JSON easily, for example:
print json_encode($artist);
This returns the following JSON string:
{
"artist_id": "",
"image": "",
"name": "",
"url": "",
"about": ""
}
Colaborations and pull requests
To keep clean code, all the scripts of the library must be formated in PSR-2 and the autoloads in PSR-4 with namespaces. Try to keep the compatibility of the library with PHP 5.4 minimum. Don't modify the composer.json if not necessary and the build test with Travis is required.
If you want to include a new function, please add the correct comments to your code using annotations and create the PHPUnit test cases in the tests path. Also you should be clear in your commits messages. Be care with the info of others developers and don't delete it from the composer file, also verify taht your info, if you want, are correct.
Thanks!
siegsb/play-extractor 适用场景与选型建议
siegsb/play-extractor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 08 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「google」 「siegsb」 「play store」 「redinput」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 siegsb/play-extractor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 siegsb/play-extractor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 siegsb/play-extractor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Google Translate Free library for PHP
A PSR-7 compatible library for making CRUD API endpoints
Magento 2 Social Login extension is designed for quick login to your Magento 2 store without procesing complex register steps
Client for Google Directions API to add interpolated points to a route consisting of given coordinates.
Google Recaptcha Package For PHP front and backend.
A lightweight plain-PHP framework for database-backed CRUD APIs.
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-08-18