Skip to content

Instantly share code, notes, and snippets.

Last active July 26, 2017 19:14
What would you like to do?
PasswordPusher Alfred Workflow: Configurable days/views
#!/usr/bin/env ruby
require "net/http"
require "uri"
require "json"
uri = URI.parse("")
data = {}
data["password[payload]"] = "{query}"
# Max 90 days
data["password[expire_after_days]"] = "7"
# Max 100 views
data["password[expire_after_views]"] = "5"
r = Net::HTTP.post_form(uri, data)
puts JSON.parse(r.body)["url_token"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment