Skip to content
This library helper is helper API for News.org written with PHP to assist making API calls to News.org for retrieving news it uses custom filtering and sorting provided by the API Vendor
PHP
Branch: master
Clone or download
Pull request Compare This branch is 19 commits ahead, 1 commit behind News-API-gh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
vendor
.gitignore
LICENSE
README.md
_config.yml
composer.json
composer.lock
phpunit.xml

README.md

News API Commercial PHP Library.

By Goodwish Matyila Support: 084 790-8653

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);
 
You can’t perform that action at this time.