posting rename

author:

contributor:

published:

updated:

source uri:

Acre Doc /freebase/acre_doc

Handler:

Default Configuration:

Acre Doc /freebase/acre_doc

Handler:

Default Configuration:

Summary

//DEF FBID FROM FORM

acre.start_response(200,{"content-type":"text/plain"})
//acre.write(acre...

Content

//DEF FBID FROM FORM

acre.start_response(200,{"content-type":"text/plain"})
//acre.write(acre.environ)

var obj = acre.environ.params;


//var obj = mjt.formdecode(acre.environ.request_body)

function entry(fbid,vote,text){return {fbid:fbid, vote:vote, text:text}}

// function post(entry){ var res = acre.urlfetch("http://acretables.appspot.com/data/vote", "POST",
// {"content-type":"application/json"},JSON.stringify([entry])) return res}

try {
function post(e){
e = [e]
acre.write(JSON.stringify(e))
var res = acre.urlfetch("http://acretables.appspot.com/data/vote", "POST",
{"content-type":"application/json"},JSON.stringify(e))
return res
}

}
catch (e) {

// application('errormsg') = ("Error name: " + e.name + ". Error description: " + e.description + ". Error number: " + e.number + ". Error message: " + e.message);

}

acre.write(JSON.stringify(entry(obj.fbid, obj.vote, obj.text)))
// var res = post(entry(obj.fbid, obj.vote, obj.text))
// var json = JSON.stringify(res.body)


// if (json.action != "ok"){acre.write("fail\n")}

// }

Created by: coco Jul 28, 2008
Last edited by: coco Aug 14, 2008

Recent Discussions about posting

There is no discussion about this document.

Start the Discussion »
Explore the Data
View all the data we have for posting
Flag this Document
Why do you want to flag this document?