Skip to content

Instantly share code, notes, and snippets.

@pglombardo
Last active July 26, 2017 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pglombardo/dc27bb1d180df13e4fcf9087d2cfca40 to your computer and use it in GitHub Desktop.
Save pglombardo/dc27bb1d180df13e4fcf9087d2cfca40 to your computer and use it in GitHub Desktop.
PasswordPusher Alfred Workflow: Configurable days/views
#!/usr/bin/env ruby
require "net/http"
require "uri"
require "json"
uri = URI.parse("https://pwpush.com/p.json")
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