PHP code example of bilginpro / agency-iha

1. Go to this page and download the library: Download bilginpro/agency-iha library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bilginpro / agency-iha example snippets


[{
		"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"]
	}
]
 php
$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]);