Commit 85fe77fe8052ff5c0f23f3449cd3f9fcecbd3f4f
- Diff rendering mode:
- inline
- side by side
sweetmaker.py
(3 / 7)
  | |||
1 | 1 | import requests | |
2 | 2 | import json | |
3 | def make(what, who, where, how): | ||
3 | |||
4 | def sweet(sweet_url, what, who, where, how): | ||
4 | 5 | sweet = {} | |
5 | 6 | sweet['what'] = what | |
6 | 7 | sweet['who'] = who | |
7 | 8 | sweet['where'] = where | |
8 | 9 | sweet['how'] = how | |
9 | 10 | sweet_list = [] | |
10 | sweet_list.append(sweet) | ||
11 | return sweet_list | ||
12 | |||
13 | |||
14 | def send(sweet): | ||
15 | request = requests.api.post(SWEET_STORE_URL,{'data':json.dumps(sweet)}) | ||
11 | request = requests.api.post(sweet_url, {'data':json.dumps(sweet)}) | ||
16 | 12 | if request.status_code == 200: | |
17 | 13 | return True | |
18 | 14 | else: |