Crazy easy downloads counting from packagist
Hi guys,
If possible I'd like to request that the script which counts downloads of extensions, in addition to parsing logs does a very simple request to Packagist to read the download count for each specific version - in order to make the download counter on TER include packagist downloads.
The procedure should be very easy:
- Iterate the list of extensions
- Parse the
composer.json
file of each to determine the composer name - If the vendor isn't
typo3-ter
query a URL:https://packagist.org/packages/$composername/downloads.json
(example: https://packagist.org/packages/fluidtypo3/flux/downloads.json) - Parse the JSON and store the values in separate columns which get updated rather than incremented
- Either pull the total download count as a
SUM()
of two DB fields or do the calculation before display
This would of course make it a lot easier to track which extensions are being downloaded and is future proof for the day we decide to use Packagist for distribution. If this is done as described above, one could theoretically disable the TER downloads and the counter would still work if the extension is on Packagist. Hint-hint, please put all exts there some day ;)