feeds
This commit is contained in:
parent
9b4943c4d5
commit
d8a7f4ebaa
4 changed files with 29 additions and 3 deletions
2
jobs/feed/__init__.py
Normal file
2
jobs/feed/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
from .cafefeed import cafefeed
|
||||||
|
from .following import followingfeed
|
||||||
9
jobs/feed/cafefeed.py
Normal file
9
jobs/feed/cafefeed.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
def cafefeed(API):
|
||||||
|
"""
|
||||||
|
List all of a token's user's feed items.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of feed items.
|
||||||
|
"""
|
||||||
|
feed = API.make_request("GET", "audrey", "feed/foryou", authenticate=True)
|
||||||
|
return feed
|
||||||
9
jobs/feed/following.py
Normal file
9
jobs/feed/following.py
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
def followingfeed(API):
|
||||||
|
"""
|
||||||
|
List all of a token's user's feed items from the users they are following.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
A list of feed items.
|
||||||
|
"""
|
||||||
|
feed = API.make_request("GET", "audrey", "feed/following", authenticate=True)
|
||||||
|
return feed
|
||||||
12
testing.py
12
testing.py
|
|
@ -14,7 +14,7 @@ if not os.getenv("client_id") or not os.getenv("client_secret"):
|
||||||
API = APIClient(
|
API = APIClient(
|
||||||
client_id=os.getenv("client_id"),
|
client_id=os.getenv("client_id"),
|
||||||
client_secret=os.getenv("client_secret"),
|
client_secret=os.getenv("client_secret"),
|
||||||
debug=False
|
debug=True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Keep a token cache to avoid unnecessary sign-ins during development.
|
# Keep a token cache to avoid unnecessary sign-ins during development.
|
||||||
|
|
@ -98,6 +98,12 @@ if not API.is_token_valid():
|
||||||
# print(post)
|
# print(post)
|
||||||
# x += 1
|
# x += 1
|
||||||
# print("-----------------------------")
|
# print("-----------------------------")
|
||||||
notifications = API.run_job('notification.listnotifications')
|
# notifications = API.run_job('notification.listnotifications')
|
||||||
print(notifications)
|
# print(notifications)
|
||||||
|
# print("-----------------------------")
|
||||||
|
# feed = API.run_job('feed.cafefeed')
|
||||||
|
# print(feed)
|
||||||
|
# print("-----------------------------")
|
||||||
|
feed = API.run_job('feed.followingfeed')
|
||||||
|
print(feed)
|
||||||
print("-----------------------------")
|
print("-----------------------------")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue