Skip to content

Instantly share code, notes, and snippets.

@lauri-kaariainen
Created May 9, 2015 07:51
Show Gist options
  • Save lauri-kaariainen/73bf327fa6ca2677e38e to your computer and use it in GitHub Desktop.
Save lauri-kaariainen/73bf327fa6ca2677e38e to your computer and use it in GitHub Desktop.
Huuto.net category and item API usage with simple PHP code
<?php
//CALLHUUTO AND ID!
if(isset($_GET['callHuuto']) && isset($_GET['id'])) {
$doc = new DOMDocument();
//error_log('http://api.huuto.net/somt/0.9/items/'.$_GET['id']);
$doc->load('http://api.huuto.net/somt/0.9/items/'.$_GET['id']);
echo $doc->saveXML();
die();
}
//CALLHUUTO AND CATEGORY! NOTICE /CLOSINGITEMS
if(isset($_GET['callHuuto']) && isset($_GET['category'])) {
$doc = new DOMDocument();
//error_log('http://api.huuto.net/somt/0.9/categories/'.$_GET['category']."/closing-items");
$doc->load('http://api.huuto.net/somt/0.9/categories/'.$_GET['category']."/closing-items");
echo $doc->saveXML();
die();
}
echo "";
die();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment