Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 104c9a4f23
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (36 sloc) 1.147 kb
<?php
$js = stripslashes($_POST['text']);
$keys = explode(",", $_POST['keys']);
$keys = array_filter($keys);
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author></author>
<documentationURL></documentationURL>
<sampleQuery></sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<inputs>';
if (count($keys)) {
foreach ($keys as $k) {
$xml .= '<key id="' . $k . '" type="xs:string" paramType="variable" required="true" />';
}
}
$xml .='
</inputs>
<execute><![CDATA[';
$xml .= $js;
$xml .= ']]></execute>
</select>
</bindings>
</table>';
$filename = "tables/" . md5($xml) . ".xml";
if (!file_exists($filename)) {
file_put_contents($filename, $xml);
}
header("content-type: application/json");
echo json_encode(array(
"filename" => "http://derek.io/~/executor/" . $filename
))
?>
Jump to Line
Something went wrong with that request. Please try again.