bilginpro / agency-iha
土耳其IHA新闻机构的爬虫。
v1.0.3
2020-01-21 10:01 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.3
- nesbot/carbon: ^1.22 || ^2.16
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: 3.*
This package is not auto-updated.
Last update: 2024-09-25 08:26:43 UTC
README
[英文] 此包是为爬取伊赫拉斯新闻社的新闻而创建的。您必须订阅IHA并获得用户凭据才能使用此包。
[土耳其] 此包是为IHA订阅者使用用户凭据爬取新闻而创建的。您可以通过以下方式获取最新新闻的列表。要使用此包,您必须是IHA订阅者,并且拥有用户信息。
安装
通过Composer
$ composer require bilginpro/agency-iha
用法
$crawler = new \BilginPro\Agency\Iha\Crawler([ 'user_code' => 'your-user-code', 'user_name' => 'your-user-name', 'password' => 'your-password', 'summaryLength' => 150 // optional ]); $news = $crawler->crawl(['limit' => 10]);
调用 $crawler->crawl()
将返回一个类似这样的数组
[{ "code": "20170831AW161286", "title": "Title of the news 1", "summary": "Summary...", "content": "Content 1", "created_at": "31.08.2017 15:56:12", "category": "Genel", "city": "Istanbul", "images": ["http:\/\/path\/to\/news1\/image1", "http:\/\/path\/to\/news1\/image2"] }, { "code": "20170831AW161287", "title": "Title of the news 2", "summary": "Summary...", "content": "Content 2", "created_at": "31.08.2017 15:56:12", "category": "Genel", "city": "Ankara", "images": ["http:\/\/path\/to\/news2\/image1", "http:\/\/path\/to\/news2\/image2"] } ]
变更日志
有关最近更改的更多信息,请参阅变更日志。
测试
$ composer test
贡献
有关详细信息,请参阅贡献指南。
安全
如果您发现任何与安全相关的问题,请通过电子邮件yavuz@bilgin.pro联系,而不是使用问题跟踪器。
鸣谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。