/user/willmoffat/apps/libWill rename

author:

contributor:

published:

updated:

source uri:

Acre Doc /freebase/acre_doc

Handler:

Default Configuration:

Acre Doc /freebase/acre_doc

Handler:

Default Configuration:

Summary

acre.log('Using libWill');

var params = acre.environ.params || {};

var query = params.query ||...

Content

acre.log('Using libWill');

var params = acre.environ.params || {};

var query = params.query || getDoc(params.queryId) || null;




function getDoc(id) {

//TODO: use freebase_api_open()

if (!id) { return null; }
var response = acre.freebase_api_open('GET', '/api/trans/raw' + id);
return response.body;
}


function die(message) {

//TODO: check what happens when you call start_response twice()

acre.start_response(200, { 'content-type': 'application/json; charset="UTF-8"' });
acre.print('uuuurrrrgggg ... dying of '+message || 'something');
acre.exit();
}

Created by: willmoffat Apr 3, 2008
Last edited by: Constant Gardener Process Aug 18, 2009

Recent Discussions about None

There is no discussion about this document.

Start the Discussion »
Explore the Data
View all the data we have for /user/willmoffat/apps/libWill
Flag this Document
Why do you want to flag this document?