-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathupdate.py
More file actions
37 lines (26 loc) · 767 Bytes
/
update.py
File metadata and controls
37 lines (26 loc) · 767 Bytes
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
33
34
35
36
37
from pprint import pprint as pp
from colorama import Fore
from buffpy.models.update import Update
from buffpy.managers.profiles import Profiles
from buffpy.managers.updates import Updates
from buffpy.api import API
# check http://bufferapp.com/developers/apps to retrieve a token
# or generate one with the example
token = "awesome_token"
# instantiate the api object
api = API(client_id="client_id",
client_secret="client_secret",
access_token=token)
# retrieve a single update based on an id
update = Update(api=api, id="update_id")
print(update)
# get update"s interactions
print(update.interactions)
# edit
update = update.edit(text="Hey!")
# publish now
update.publish()
# move to top
update.move_to_top()
# delete
update.delete()