-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
32 lines (31 loc) · 1.34 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from app import send, app
import json
from datetime import datetime, timezone
def example_upload():
my_url = 'https://example.com/u/example'
now = datetime.now(timezone.utc).isoformat()
idx = str(8)
print(repr(send('tiny.tilde.website', '/inbox', idx, 'Create',
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": my_url + "/" + idx,
"type": "Note",
"attributedTo": my_url,
"published": now,
"to": ["https://tiny.tilde.website/users/insom"],
'tag': [
{
'type': 'Mention',
'href': 'https://tiny.tilde.website/users/insom',
'name': '@insom@tiny.tilde.website',
},
],
"attachment": [
{
"type": "Image",
"mediaType": "image/jpeg",
"url": "https://example.com/example.png",
"name": "example alt text",
}
]
})))