close

  
<p> /*function get_names(gs)
{
  var names=[];
  if ('name' in gs &amp;&amp; 'timestamp&gt;' in gs) names.push(gs.name);
  for each (prop in gs) if (typeof prop=='object') names=names.concat(get_names(prop));
  return names;
}*/

params=acre.request.params;
//names=get_names(acre.require('gold_standard').gold_standards[params.index]);
names=JSON.parse(params.names);
if (names.length)
{
  query={'name|=':names,name:null,id:null,timestamp:null,type:[],sort:['name','timestamp'],'creator':null,'limit':1000};
  days=parseInt(params.days);
  if (!isNaN(days)) 
  {
    d=new Date();
    d.setDate(d.getDate()-days);
    query['timestamp&gt;=']=acre.freebase.date_to_iso(d);
  }
  result=JSON.stringify(acre.freebase.mqlread([query]).result);
}
else result='[]';
acre.write(result);
acre.response.status = 200;
acre.response.set_header("content-type", "application/json");

 </p>

Comments

Hide