bilginpro / agency-iha
Crawler for IHA News Agency in Turkey.
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-11-06 08:59:15 UTC
README
[EN] This package is created for crawling news from Ihlas Haber Ajansi. You have to be subscribed to IHA and obtain user credentials for being able to use this package.
[TR] Bu paket İHA abonelerinin kullanıcı bilgileriyle haberleri taramaları için oluşturulmuştur. Aşağıdaki şekilde kullandığınızda son eklenen haberlerden istediğiniz adette haberi dizi olarak alabilirsiniz. Paketi kullanmak için İHA abonesi olmalı ve kullanıcı bilgilerine sahip olmalısınız.
Install
Via Composer
$ composer require bilginpro/agency-iha
Usage
$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]);
Calling $crawler->crawl()
will return an array like this:
[{ "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"] } ]
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email yavuz@bilgin.pro instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.