diff options
author | Nat Lasseter <user@4574.co.uk> | 2025-02-18 15:25:49 +0000 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2025-02-18 15:25:49 +0000 |
commit | b50766d496010bf2856dac88d97c236cf5944ae6 (patch) | |
tree | d8db60dce038de43876ff5544828b92614315e9d /2.1/get_mail.rb |
Restart git history without references to work email
Previous commits:
Author: Nat Lasseter <user@4574.co.uk>
Date: 2025-02-18 15:15:27 +0000
[3.2] Tickets have fixed 8-hour lifetimes now
Author: Nat Lasseter <user@4574.co.uk>
Date: 2025-02-18 15:15:27 +0000
[3.11] Added .keytab file, got rid of get_ticket.
Author: Nat Lasseter <user@4574.co.uk>
Date: 2025-02-18 15:15:27 +0000
[3.1] Added the TGS
Author: Nat Lasseter <user@4574.co.uk>
Date: 2025-02-18 15:15:27 +0000
Add readme
Author: Nat Lasseter <user@4574.co.uk>
Date: 2025-02-18 15:15:27 +0000
Up to end of scene 2
Diffstat (limited to '2.1/get_mail.rb')
-rwxr-xr-x | 2.1/get_mail.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/2.1/get_mail.rb b/2.1/get_mail.rb new file mode 100755 index 0000000..b212aed --- /dev/null +++ b/2.1/get_mail.rb @@ -0,0 +1,24 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'uri' +require 'json' + +uri = URI.parse("http://localhost:4568/login") + +header = {'Content-Type': 'text/json'} + +print "Username: "; un = gets.strip +print "Ticket: "; t = gets.strip + +login = { + "username": un, + "ticket": t +} + +http = Net::HTTP.new(uri.host, uri.port) +request = Net::HTTP::Post.new(uri.request_uri, header) +request.body = login.to_json + +response = http.request(request) +puts response.body |