import requests  # Apache 2.0
import numpy as np

callbacktable = {"myFunc": "hello_world"}


def hello_world():
    print('Hello World!')


if __name__ == '__main__':
    globals()[callbacktable["myFunc"]]()
    response = requests.get(f"https://history.muffinlabs.com/date", headers={"Accept": "application/json"})
    result = response.json()
    print('Done')
    facts = np.random.choice(result['data']['Events'], 5)
    print('5 Random History Facts about today:')
    for fact in facts:
        print(f'In {fact["year"]}: {fact["text"]}')