Skip to content

Instantly share code, notes, and snippets.

@ayosec
Last active August 29, 2015 14:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayosec/35867a22e1f2986546aa to your computer and use it in GitHub Desktop.
Save ayosec/35867a22e1f2986546aa to your computer and use it in GitHub Desktop.
Launch Cypher queries
#!/usr/bin/env ruby
case ARGV.size
when 1
host = ARGV[0]
body = STDIN.read
when 2
host = ARGV[0]
body = ARGV[1]
else
puts "Usage #$0 host [cypher]"
exit 1
end
require "json"
body = { query: body }.to_json
exec "curl", "-w", "\n", "-s", "#{host}/db/data/cypher", "-H", "Content-Type: application/json", "-d", body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment