newsorg/commercial

News API Commercial PHP Library.

dev-master 2021-04-30 05:20 UTC

This package is not auto-updated.

Last update: 2024-04-25 20:47:26 UTC


README

By Goodwish Support: 087 057-1581 https://www.goodwishmatyila.co.za

Installation

 
composer require newsorg/commercial

This package is not auto-updated. Please set up the GitHub Service Hook for Packagist so that it gets updated whenever you push!
News API Commercial PHP Library.

Requirements

cUrl Extensions

PHP >= 7.0

#Require the class

require_once 'News.php';

Include namespace

use News\Resources as Articles;

Extend base class

class Latest extends Articles{
	public function __construct(){
		parent::__construct();
	}
}

Usage, Get Everything

 $queryOptionsEverything = Array(
	"apiKey"=>"your-api-key", 
	"from" => "2008-03-02",
	"to"=>"2018-08-05",
	"query" => "news-south-africa",
	"language" => "en"
	);

Pass the options to setEverything with argument

 Latest::setEverything($queryOptionsEverything);
 

Usage, Get sources

 $queryOptionsSources = Array(
	"apiKey"=>"your-api-key", 
	"from" => "2008-03-02",
	"to"=>"2008-03-05",
	"query" => "soccer",
	"country" => "za",
	"language" => "en"
	);

Pass the options to setSources with argument

 Latest::setSources($queryOptionsSources);
 

Usage, Get Headlines

 $queryOptionsHeadlines = Array(
	"apiKey"=>"your-api-key", 
	"from" => "2008-03-02",
	"to"=>"2008-03-05",
	"query" => "soccer",
	"country" => "za",
	"language" => "en"
	);
 

Pass the options to setHeadlines with argument

 Latest::setHeadlines($queryOptionsHeadlines);