mirror of
https://github.com/simon987/parler-tricks.git
synced 2025-12-19 17:24:54 +00:00
Initial commit
This commit is contained in:
27
parler/discover.py
Normal file
27
parler/discover.py
Normal file
@@ -0,0 +1,27 @@
|
||||
class DiscoverAPI:
|
||||
def __init__(self, session, root_url="http://api.parler.com"):
|
||||
self.root_url = root_url
|
||||
self.s = session
|
||||
|
||||
def add_post_to_discover_page(self, postId, *args, **kwargs):
|
||||
return self.s.post("{}/v1/discover/posts/{}/add".format(self.root_url, postId), *args, **kwargs)
|
||||
|
||||
# limit, startKey
|
||||
def get_discover_hashtags(self, *args, **kwargs):
|
||||
# app has this bug too :)
|
||||
return self.s.get("{}/v1/discover/hashtags".format(self.root_url), *args, **kwargs)
|
||||
|
||||
# limit, startKey
|
||||
def get_discover_news(self, *args, **kwargs):
|
||||
return self.s.get("{}/v1/discover/news".format(self.root_url), *args, **kwargs)
|
||||
|
||||
# limit, startKey
|
||||
def get_discover_posts(self, *args, **kwargs):
|
||||
return self.s.get("{}/v1/discover/posts".format(self.root_url), *args, **kwargs)
|
||||
|
||||
# limit, startKey
|
||||
def get_discover_users(self, *args, **kwargs):
|
||||
return self.s.get("{}/v1/discover/users".format(self.root_url), *args, **kwargs)
|
||||
|
||||
def remove_post_from_discover_page(self, postId, *args, **kwargs):
|
||||
return self.s.delete("{}/v1/discover/posts/{}/remove".format(self.root_url, postId), *args, **kwargs)
|
||||
Reference in New Issue
Block a user