Skip to content

Instantly share code, notes, and snippets.

@eiriksm
Created November 2, 2014 15:35
Show Gist options
  • Save eiriksm/59371b0bb8e16788dfdd to your computer and use it in GitHub Desktop.
Save eiriksm/59371b0bb8e16788dfdd to your computer and use it in GitHub Desktop.
js usage
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
var node_object = {
"type": prompt("Enter content type"),
"title": prompt("Enter node title"),
"body": {
"und": [
{"value": prompt("Enter body text"); }
]
},
"created": timestamp,
"status": 1
};
url = "http://example.com/services/endpoint";
drupalServicesPostNode(node_object, url, function() {
alert('Node posted!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment