balsama/drupalorg-dom-parser
Composer 安装命令:
composer require balsama/drupalorg-dom-parser
包简介
Scrapes statistics about projects on Drupal.org
README 文档
README
Drupal.org DOM Parser
Retrieves information about a specified project from Drupal.org.
Usage
$project_name = 'ctools';
$project_stats = new Balsama\DrupalOrgProject\Stats($project_name);
Available information
General (Taken from the "Project information" section of the project page)
- Total downloads
$project->getTotalDownloads - Total installs
$project->getTotalInstalls
Releases (Deduced from the "Downloads" section of the project page)
- Drupal 8 Stability
$project_stats->getD8Stability
Usage (Taken from the Project Usage table on the "project/usage" page)
- Current Drupal 8 usage
$project_stats->getCurrentD8Usage - Current Drupal 7 usage
$project_stats->getCurrentD7Usage - All usage data
$project_stats->getAllUsage
Other
- Human-readable name
$project_stats->getHumanReadableName - Machine name
$project_stats->getMachineName
Other classes
If you're only interested in getting the info from the usage table, you can use the Usage class instead which only
fetches data from the /project/usage/{project_name} page. This is somewhat less likely to break as D.O seems to change
the markup of that page less frequently.
Why?
At the time this was created, there wasn't any public facing D.O API. Even now, there is some information that's either not available or is cumbersome to get via the API.
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-12-29