Skip to content

Instantly share code, notes, and snippets.

@johnta0
Last active August 1, 2018 05:49
Show Gist options
  • Save johnta0/1e09170210661bd0ac8f07f8609bd6ae to your computer and use it in GitHub Desktop.
Save johnta0/1e09170210661bd0ac8f07f8609bd6ae to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import hmac
import hashlib
import urllib.parse
import xerox
# URLの入力を受け取る
url = str(input('Input the original URI:'))
# ハッシュ計算(keyは受け取るだけ)
digest = hmac.new('0x24FEEDFACEDEADBEEFCAFE'.encode('utf-8'), msg=url.encode('utf-8'), digestmod=hashlib.sha1).hexdigest()
proxy_url = 'http://localhost:8081/' + digest + '?url=' + url
print("urlはクリップボードにコピーされました")
print(proxy_url)
xerox.copy(proxy_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment