From 5d580b29957fa8b03fb2bfe580d18aead2e22fd6 Mon Sep 17 00:00:00 2001 From: atomaka Date: Wed, 19 Oct 2011 10:51:33 -0400 Subject: [PATCH] Driver file for new module system for testing purposes. --- public_html/resource_driver.php | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 public_html/resource_driver.php diff --git a/public_html/resource_driver.php b/public_html/resource_driver.php new file mode 100644 index 0000000..59b1dea --- /dev/null +++ b/public_html/resource_driver.php @@ -0,0 +1,47 @@ + 'Twitter', + 'type' => 'json', + 'url' => 'https://api.twitter.com/1/statuses/user_timeline.json?include_entities={include_entities}&include_rts={include_rts}&screen_name={screen_name}&count={count}', + 'required' => array('screen_name'), + 'arguments' => array('atomaka',1) +); +// $configs[] = json_encode($twt_config); + + +$sc2_config = array( + 'name' => 'Sc2Ranks', + 'type' => 'json', + 'url' => 'http://sc2ranks.com/api/base/teams/us/{character}${code}.json?appKey={key}', + 'required' => array('character','code','key'), + 'arguments' => array('Gaffer','888','whoisandrew.com') +); +// $configs[] = json_encode($sc2_config); + +$data = array(); +foreach($configs as $config) { + $json = json_decode($config); + include 'lib/' . strtolower($json->name) . '.php'; + + // prepare arugments + $arguments = array(); + foreach($json->arguments as $argument) { + $arguments[] = $argument; + } + + $res = new $json->name($config); + call_user_func_array(array($res,'setOptions'), $arguments); + $data[$json->name] = $res->getParsedData(); + //$res->debugInformation(); +} + +echo '

Return Results


';
+print_r($data);
+echo '
'; + +?> \ No newline at end of file