mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 06:44:22 +01:00
Add _RecursiveSerializer class in bfxapi/labeler.py file. Add support to new pulse endpoints (with serializers and types). Add examples/rest/get_pulse_data.py demo.
This commit is contained in:
22
examples/rest/get_pulse_data.py
Normal file
22
examples/rest/get_pulse_data.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# python -c "from examples.rest.get_pulse_data import *"
|
||||
|
||||
import time
|
||||
|
||||
from bfxapi.client import Client, Constants
|
||||
|
||||
bfx = Client(
|
||||
REST_HOST=Constants.REST_HOST
|
||||
)
|
||||
|
||||
now = int(round(time.time() * 1000))
|
||||
|
||||
messages = bfx.rest.public.get_pulse_history(end=now, limit=100)
|
||||
|
||||
for message in messages:
|
||||
print(f"Message: {message}")
|
||||
print(message.CONTENT)
|
||||
print(message.PROFILE.PICTURE)
|
||||
|
||||
profile = bfx.rest.public.get_pulse_profile("News")
|
||||
print(f"Profile: {profile}")
|
||||
print(f"Profile picture: {profile.PICTURE}")
|
||||
Reference in New Issue
Block a user