Skip to content

Instantly share code, notes, and snippets.

@under0tech
Created October 3, 2022 18:29
Show Gist options
  • Save under0tech/da5eaf7eb3c4793ff7facf76a1193199 to your computer and use it in GitHub Desktop.
Save under0tech/da5eaf7eb3c4793ff7facf76a1193199 to your computer and use it in GitHub Desktop.
# Publish predictions fot the stock
def PublishPredictions(stock, day_1, day_2, day_3):
publisher = pubsub_v1.PublisherClient(credentials=credentials)
topic_path = publisher.topic_path(PUBSUB_PROJECT_ID, PUBSUB_ORACULAR_TOPIC_ID)
data_str = f'{stock}'
data = data_str.encode("utf-8")
publisher.publish(topic_path, \
data, \
stock=stock, \
day_1=f'{day_1}', \
day_2=f'{day_2}', \
day_3=f'{day_3}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment