The goal is to be able to create a data set for analyzing hook usage. The data set should be represnted as a CSV file that can be imported into a spreadsheet or an SQL database for analysis.
The script takes as input a file that contains the name of an extension in each line.
For reach extension name (i.e. for each line in the file), the script loads the extension.json file for that extension from the git repo. That can be done using the following URL pattern: https://raw.githubusercontent.com/wikimedia/mediawiki-extensions-{NAME}/master/extension.json.
From the extension.json file, the script looks at the top level key "Hooks", which contains an object (a map) of hook names to hook hander names. We are only interested in the hook names, the handler can be ignored.
For each entry in the Hooks map, the script output as csv line, with the extension name in the first column, and the hook name in the second column.