eddiegulay / necta_api
此软件包最新版本(dev-main)没有可用的许可证信息。
从NECTA网站抓取网络结果的工具
dev-main
2023-07-03 08:35 UTC
Requires
- fabpot/goutte: ^3.3
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-03 11:33:13 UTC
README
NECTA API是一个基于PHP的API,提供访问坦桑尼亚学校2021年至2023年的国家考试成绩的功能。它允许您从坦桑尼亚国家考试委员会(NECTA)获取关于学校及其相应成绩的数据。
功能
- 检索特定年份坦桑尼亚学校的国家考试成绩。
- 获取有关学校和其成绩的详细信息。
- 基于各种标准搜索学校和结果。
- 以标准化格式访问数据,便于与其他应用程序集成。
要求
- PHP 7.0或更高版本
- Composer(依赖管理器)
获取考试中心
require 'centers.php'; // get_centers(year, json){ // year: year of examination // json: true or false //} $centers = get_centers(2021); print_r($centers);
输出
返回的数据以三组为单位(每行有3个中心数据)
[0] => Array ( [0] => Array ( [number] => 0101 [reg_no] => P0101 [name] => P0101 AZANIA CENTRE [link] => https://onlinesys.necta.go.tz/results/2021/csee/results/p0101.htm ) [1] => Array ( [number] => 0104 [reg_no] => P0104 [name] => P0104 BWIRU BOYS CENTRE [link] => https://onlinesys.necta.go.tz/results/2021/csee/results/p0104.htm ) [2] => Array ( [number] => 0108 [reg_no] => P0108 [name] => P0108 IFUNDA CENTRE [link] => https://onlinesys.necta.go.tz/results/2021/csee/results/p0108.htm ) ) ...
获取学校成绩
require 'school.php'; $year = 2021; $school_reg_no = "p0104"; $res = get_school_results($school_reg_no, $year);
输出
Array ( [0] => Array ( [CNO] => CNO [SEX] => SEX [AGGT] => AGGT [DIV] => DIV [DETAILED SUBJECTS] => DETAILED SUBJECTS ) [1] => Array ( [CNO] => P0104/0001 [SEX] => F [AGGT] => - [DIV] => IV [DETAILED SUBJECTS] => CIV - 'C' HIST - 'D' GEO - 'D' BIO - 'D' ) [2] => Array ( [CNO] => P0104/0002 [SEX] => F [AGGT] => 35 [DIV] => 0 [DETAILED SUBJECTS] => CIV - 'F' HIST - 'F' GEO - 'F' KISW - 'F' ENGL - 'F' CHEM - 'F' BIO - 'F' ) [3] => Array ( [CNO] => P0104/0003 [SEX] => F [AGGT] => - [DIV] => IV [DETAILED SUBJECTS] => GEO - 'D' BIO - 'D' ) ...
重要
目前API仅支持2020年和2021年的csee成绩。我们正在努力添加更多年份。