[EN] This package is created for crawling news from Dogan Haber Ajansi. You have to be subscribed to DHA and obtain user credentials for being able to use this package.
[TR] Bu paket DHA 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 DHA abonesi olmalı ve kullanıcı bilgilerine sahip olmalısınız.
Via Composer
$ composer require bilginpro/agency-dha
$crawler = new \BilginPro\Agency\Dha\Crawler([
'x_code' => 'your-x-parameter',
'y_code' => 'your-y-parameter',
'summaryLength' => 150 // optional
]);
$news = $crawler->crawl(['limit' => 10]);
Calling $crawler->crawl()
will return an array like this:
[{
"code": "737561a6b989cb305300fd60995140fe",
"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": "737561a6b989cb305300fd60995140fc",
"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"]
}
]
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.