Ejemplo n.º 1
0
def get_links():
    try:
        notion_api = NotionApi()

        current_day = notion_api.current_day()
        current_week = notion_api.current_week()

        return jsonify(
            current_day=app_url(current_day.get_browseable_url()),
            current_week=app_url(current_week.get_browseable_url()),
        )
    except Exception:
        return 'Failed fetching current links', 500
Ejemplo n.º 2
0
#!/usr/local/bin/python3

from notionscripts.notion_api import NotionApi
api = NotionApi()


def app_url(browser_url):
    return browser_url.replace("https://", "notion://")


message = None
for row in api.get_current_tasks():
    message = "%s | href=%s" % (row.title, app_url(row.get_browseable_url()))
    print(message)

if message is None:
    message = "Working on Nothing | href=%s" % app_url(
        api.current_day().get_browseable_url())
    print(message)