PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Dave Smith  >  MediaStack Live PHP News Feed Wrapper  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Usage
Class: MediaStack Live PHP News Feed Wrapper
Get the news from around the world with MediaStack
Author: By
Last change:
Date: 1 year ago
Size: 879 bytes


Class file image Download
example usage
mediaStack ver 1.0

You must get an API key from
and enter it in the marketstack.class.php file

For complete documentation on each endpoint and available paramaters

//instantiate the class
$media = new mediaStack();

//get 10 news stories on tennis from the USA


//display stories
foreach( $media->response->data as $story ){
'<div>'.$story->published_at.': '.$story->source.' reports '.$story->title.' [<a href="'.$story->url.'" target="_blank">Full Story</a>]</div>';

For more information send a message to info at phpclasses dot org.