Last active
July 26, 2017 19:14
-
-
Save pglombardo/dc27bb1d180df13e4fcf9087d2cfca40 to your computer and use it in GitHub Desktop.
PasswordPusher Alfred Workflow: Configurable days/views
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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