Skip to content

Instantly share code, notes, and snippets.

@TioBorracho
Created September 21, 2012 18:39
Show Gist options
  • Save TioBorracho/3763142 to your computer and use it in GitHub Desktop.
Save TioBorracho/3763142 to your computer and use it in GitHub Desktop.
Opening gzipped json for all categories in MELI (MLA)
<?php
ini_set("memory_limit","500M"); //less should be enough, but I came to this number checking
$options = array('http'=>array('header'=>"Accept-Encoding: gzip\r\n"));
$context = stream_context_create($options);
$results = file_get_contents('compress.zlib://https://api.mercadolibre.com/sites/MLA/categories/all', 0, $context);
$results = json_decode($results);
//print_r($results);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment