published
updated
source uri
author
contributor
Handler
acre handler
plural name
  • Scripts
Test
path
  • ?vote=1&text=hello&fbid=78

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
View topic history »

Comments

There is no discussion about this document.

Start the Discussion »