SHARE
TWEET

Untitled

a guest Aug 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import requests
  2. import json
  3.  
  4. def post_webhook(name, content):
  5.     request = {
  6.         "username": "",
  7.         "content": ""
  8.     }
  9.     headers = {'content-type': 'application/json'}
  10.     url="replace webhookurl"
  11.  
  12.     request['username'] = name
  13.     request['content'] = content
  14.     response = requests.post(url, data=json.dumps(request), headers=headers)
  15.  
  16. import sys
  17.  
  18. index = 0
  19. text = ""
  20. for line in iter(sys.stdin.readline, ""):
  21.     text += line
  22.  
  23. post_webhook("hoge",text)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top