Skip to content

Instantly share code, notes, and snippets.

@epok07
Created March 14, 2018 07:51
Show Gist options
  • Save epok07/d42c502c1d1ee1f6a81a1e21520e8113 to your computer and use it in GitHub Desktop.
Save epok07/d42c502c1d1ee1f6a81a1e21520e8113 to your computer and use it in GitHub Desktop.
LuxuriousWryPointsPHP created by epok07 - https://repl.it/@epok07/LuxuriousWryPointsPHP
echo "Hello Franck! \n\r";
$url = 'https://newsapi.org/v2/top-headlines?' .
'country=us&' .
//'source=techcrunch&' .
'apiKey=b714f12698014cf4aac6cd930ab5ffae';
$topnews = ( json_decode(file_get_contents($url)) );
$json_string = json_encode($topnews, JSON_PRETTY_PRINT);
echo $json_string .'\n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment