前几天看到一个Haskell项目:y-taka-23/thank-you-stars,功能很简单,查看项目依赖,然后去Github添加星星。在Github上搜索了一下,发现很多语言都有类似的项目,但是PHP没有,于是自己做了一个PHP版本:oraoto/thank-you-stars原理composer.json记录了项目的依赖:“require”:{"php":">=5.6.4","laravel/framework":"5.3.*","predis/predis":"1.0.*"},"require-dev":{"phpunit/phpunit":"6.2"}包名和Github仓库名可能不一样,所以先去Packgist找到对应的Github仓库:$curlhttps://packagist.org/search.json?q=laravel/laravel&per_page=1{"results":[{"name":"laravel/laravel","description":"TheLaravelFramework.","url":"https://packagist.org/packages/laravel/laravel","repository":"https://github.com/laravel/laravel","downloads":5816206,"favers":35260}],"total":24,"next":"https://packagist.org/search.json?q=laravel/laravel&page=2&per_page=1"}其中repository为仓库地址,可以从中截取作者和仓库名调用Github星级界面。还是直接看Readme比较好,可能是网络问题,感觉很慢,加个星需要10秒。
