mirror of
https://github.com/simon987/parler-tricks.git
synced 2025-12-15 23:59:09 +00:00
reformat, add setup.py
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
|
||||
class ConversionAPI:
|
||||
def __init__(self, session, root_url="http://api.parler.com"):
|
||||
self.root_url = root_url
|
||||
self.s = session
|
||||
|
||||
def convert(self, _type, uuid):
|
||||
'''
|
||||
"""
|
||||
GET /v3/idConversion/{type}/{uuid}
|
||||
params:
|
||||
type: one of (user, post, comment, image, video, link)
|
||||
@@ -14,13 +13,13 @@ class ConversionAPI:
|
||||
hidden sequential ID, as protobuf varint
|
||||
rate-limit: none
|
||||
auth: yes
|
||||
'''
|
||||
"""
|
||||
return self.s.get(
|
||||
"{}/v3/idConversion/{}/{}".format(self.root_url, _type, uuid)
|
||||
)
|
||||
|
||||
def reverse_convert(self, _type, _id):
|
||||
'''
|
||||
"""
|
||||
GET /v3/uuidConversion/{type}/{id}
|
||||
(*) this is enumerable
|
||||
params:
|
||||
@@ -30,7 +29,7 @@ class ConversionAPI:
|
||||
public-facing UUID of the entity
|
||||
rate-limit: none
|
||||
auth: yes
|
||||
'''
|
||||
"""
|
||||
return self.s.get(
|
||||
"{}/v3/uuidConversion/{}/{}".format(self.root_url, _type, _id)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user