{"id":283,"date":"2021-10-18T05:35:11","date_gmt":"2021-10-18T05:35:11","guid":{"rendered":"https:\/\/sznetwork.systems\/?page_id=283"},"modified":"2025-05-21T15:28:43","modified_gmt":"2025-05-21T13:28:43","slug":"sz_swtime_bot","status":"publish","type":"page","link":"https:\/\/sznetwork.systems\/?page_id=283","title":{"rendered":"SZ_SWTime_bot (Migrated)"},"content":{"rendered":"\n<p>This is small self hosted Telegram Bot written on python to save baby sleep and awake time. Based on python app SZ_BabySWTime. For time saving uses SQLite database.<br>Main function is to add time when baby go to sleep and when wake up. For simple use i decide to use Telegram.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"SZ BabySWTime_bot echo telegram bot written on python\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/HcPylmrwjrg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Features:<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">- Add sleep time\n- Add awake time\n- View baby awaken time in table mode with dates\n- View baby sleep time in table mode with dates<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Commands:<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">\/start - to start bot\n\/help - open list with commands\n\/adds - saves time when baby go to sleep (enter \"back\" to exit from adds menu)\n\/addw - saves time when baby waked up (enter \"back\" to exit from addw menu)\n\/shows - show table with calculated sleep time\n\/showa - show table with calculated awake time\n\/delall - full erase of database\n\/dels - delete last sleep record\n\/dela - delete last wake up record<\/pre>\n\n\n\n<p>Program depends of PrettyTable module and pyTelegramBotApi<br>that can be installed by &#8220;pip install prettytable&#8221;<br>and &#8220;pip install pyTelegramBotAPI&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running:<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">When bot starts first time it check Database.db and config.txt file\nIf files don't exist, bot create them.\nDatabase.db after created is ready to work\nIn<strong> config.txt<\/strong> must be edited TOKEN field\n<strong>TOKEN = your token of telegram bot<\/strong>\nAfter TOKEN endited run bot one more time<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Code:<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>config.txt<\/strong>\n\nTOKEN = your token\n\n<strong>main.py<\/strong>\n\n# SZ_BabySWTime_bot_1.0\n# App that writes time to DB and calculate how much baby\n# sleep or awake\n\n# Usage\n# help - open list with commands\n# adds - saves time when baby go to sleep (enter \"back\" to exit from adds menu)\n# addw - saves time when baby waked up (enter \"back\" to exit from addw menu)\n# shows - show table with calculated sleep time\n# showa - show table with calculated awake time\n# delall - full erase of database\n# dels - delete last sleep record\n# dela - delete last wake up record\n\n\n# Program depends of PrettyTable module and pyTelegramBotApi\n# that can be installed by \"pip install prettytable\" \n# and \"pip install pyTelegramBotAPI\"\n\nimport telebot\nimport os\nimport sqlite3\n# time_calc_f.py functions that calculate sleep and awake time\nimport time_calc_f\nfrom prettytable import PrettyTable\nfrom datetime import date\nfrom sys import exit\n\nprint(\"Bot starting...\")\nprint(\"Checking database... \")\n\n\n# Checking if DB file exist\nif os.path.isfile('Database.db'):\n    print(\"Exist\")\nelse:\n    print(\"Not Exist\")\n    print(\"Creating database...\")\n    con = sqlite3.connect('Database.db') \n    cur = con.cursor()\n# Create table \n    cur.execute('''CREATE TABLE add_sleep (id INTEGER PRIMARY KEY, date text, hour text, minute text)''')\n    cur.execute('''CREATE TABLE add_wakeup (id INTEGER PRIMARY KEY, date text, hour text, minute text)''')\n    cur.execute('''CREATE TABLE sleep_time (id INTEGER PRIMARY KEY, date text, time text)''')\n    cur.execute('''CREATE TABLE wakeup_time (id INTEGER PRIMARY KEY, date text, time text)''')\n\n\n# Checking if config file exists\nprint(\"Checking config file... \")\nif os.path.isfile('config.txt'):\n    print(\"Exist\")\nelse:\n# Creating file if not exist\n    with open('config.txt', 'w') as f:\n        f.write('TOKEN = token example')\n    exit()\n\n\nprint(\"Bot started\")\n\n\n# Parsing TOKEN from config file\nwith open('config.txt') as f:\n   lines = f.readlines()\n\nfor line in lines:\n    \n   if \"TOKEN\" in line:\n       ext_token = line.split(\" = \")[1]\n       rep=[\"\\n\"]\n       for r in rep:\n          ext_token=ext_token.replace(r,\"\")\n\n\n# BOT Token\nbot = telebot.TeleBot(ext_token)\n\n\n# BOT Start Message\n@bot.message_handler(commands=['start'])\ndef send_welcome(message):\n\tbot.reply_to(message, \"\"\"\n\tHi, this is Telegram bot which calculate baby sleep time. For more information use command \/help\"\"\")\n\n\n# BOT Help Message\nhelp_message = \"\"\"\n&lt;b&gt;SZ_BabySWTime_console_1.0&lt;\/b&gt;\\n\\n\nCommands:\\n\n&lt;b&gt;\/help&lt;\/b&gt; - open list with commands\\n\n&lt;b&gt;\/adds&lt;\/b&gt; - saves time when baby go to sleep (enter \\\"back\\\" to exit from adds menu)\\n\n&lt;b&gt;\/addw&lt;\/b&gt; - saves time when baby waked up (enter \\\"back\\\" to exit from addw menu)\\n\n&lt;b&gt;\/shows&lt;\/b&gt; - show table with calculated sleep time\\n\n&lt;b&gt;\/showa&lt;\/b&gt; - show table with calculated awake time\\n\n&lt;b&gt;\/delall&lt;\/b&gt; - full erase of database\\n\n&lt;b&gt;\/dels&lt;\/b&gt; - delete last sleep record\\n\n&lt;b&gt;\/dela&lt;\/b&gt; - delete last wake up record\\n\n\"\"\"\n@bot.message_handler(commands=['help'])\ndef send_welcome(message):\tbot.send_message(message.chat.id, help_message.format(message.chat.id, bot.get_me()), parse_mode='html')\n\n\n# BOT Add Sleep Command \n@bot.message_handler(commands=['adds'])\ndef adds_f(message):\n    bot.send_message(message.chat.id, \"Enter time when go to sleep (time format XX:XX):\")\n    bot.register_next_step_handler(message, add_sleep_time_f)\n# Checking for correct symbols entered    \ndef add_sleep_time_f(message):\n    if len(message.text) == 5:\n        if message.text[0:2].isnumeric() and message.text[2] == \":\" and message.text[3:5].isnumeric():\n           if (int(message.text[0:2]) &gt;=0 and int(message.text[0:2]) &lt;=24) and (int(message.text[3:5]) &gt;=0 and int(message.text[3:5]) &lt;=59):\n               sleep_hour = message.text[0:2]\n               sleep_minute = message.text[3:5]\n# Write time to add_sleep table \n## Checking if clean table add_sleep in DB \n               con = sqlite3.connect('Database.db')\n               cur = con.cursor()\n               cur.execute(\"SELECT id FROM add_sleep ORDER BY id DESC LIMIT 1\")\n               if cur.fetchone() is None:\n                   cur.execute(\"\"\"INSERT INTO add_sleep (date, hour, minute ) \n                   VALUES (?, ?, ?)\"\"\", (date.today(), sleep_hour, sleep_minute))\n                   con.commit()\n                   con.close()\n                   bot.send_message(message.chat.id, \"Sleep time saved\")\n## Check if table add_wakeup has record\n               else:\n                   cur.execute(\"SELECT id FROM add_sleep ORDER BY id DESC LIMIT 1\")\n                   sleep_exist_id = int(cur.fetchone()[0])\n                   cur.execute(\"\"\"SELECT id FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n                   wakeup_exist_id = int(cur.fetchone()[0])\n                   if sleep_exist_id == wakeup_exist_id:\n                       cur.execute(\"\"\"INSERT INTO add_sleep (date, hour, minute ) \n                       VALUES (?, ?, ?)\"\"\", (date.today(), sleep_hour, sleep_minute))\n                       con.commit()\n                       con.close()\n                       get_data_from_add_wakeup() \n                       bot.send_message(message.chat.id, \"Sleep time saved\") \n                   else:\n                       bot.send_message(message.chat.id, \"Please enter wake up time\")\n           else:\n               bot.send_message(message.chat.id, \"Value not correct\")\n               adds_f(message)\n               \n        else:\n            bot.send_message(message.chat.id, \"Value not correct\")\n            adds_f(message)   \n\n    elif message.text == \"back\":\n         pass\n    else:\n        bot.send_message(message.chat.id, \"Value not correct\")\n        adds_f(message)\n\n\n# BOT Add Wake Up Command \n@bot.message_handler(commands=['addw'])\ndef addw_f(message):\n    bot.send_message(message.chat.id, \"Enter time when waked up (time format XX:XX):\")\n    bot.register_next_step_handler(message, add_wakeup_time_f)\n# Checking for correct symbols entered \ndef add_wakeup_time_f(message):\n    if len(message.text) == 5:\n        if message.text[0:2].isnumeric() and message.text[2] == \":\" and message.text[3:5].isnumeric():\n           if (int(message.text[0:2]) &gt;=0 and int(message.text[0:2]) &lt;=24) and (int(message.text[3:5]) &gt;=0 and int(message.text[3:5]) &lt;=59):\n               wake_hour = message.text[0:2]\n               wake_minute = message.text[3:5]\n# Write time to add_sleep table\n## Check if table add_sleep is clean                \n               con = sqlite3.connect('Database.db')\n               cur = con.cursor()\n               cur.execute(\"SELECT id FROM add_sleep ORDER BY id DESC LIMIT 1\")\n               if cur.fetchone() is None:\n                  bot.send_message(message.chat.id, \"Please enter sleep time\")\n                  #print(\"Please enter sleep time\")\n# Check if table add_wakeup has record\n               else:\n                  cur.execute(\"SELECT id FROM add_sleep ORDER BY id DESC LIMIT 1\")\n                  sleep_exist_id = cur.fetchone()\n                  if sleep_exist_id is not None:\n                    sleep_exist_id = (int(sleep_exist_id[0]))\n                    cur.execute(\"\"\"SELECT id FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n                    wakeup_exist_id = cur.fetchone()\n                  if wakeup_exist_id is not None:\n                    wakeup_exist_id = (int(wakeup_exist_id[0]))\n                  else:\n                    wakeup_exist_id = 0\n                  if sleep_exist_id &gt; wakeup_exist_id:\n                    cur.execute(\"\"\"INSERT INTO add_wakeup (date, hour, minute ) \n                    VALUES (?, ?, ?)\"\"\", (date.today(), wake_hour, wake_minute))\n                    con.commit()\n                    con.close()\n                    get_data_from_add_sleep()\n                    bot.send_message(message.chat.id, \"Wake up time saved\")\n                  else:\n                   bot.send_message(message.chat.id, \"No sleep record found\")\n               \n           else:\n                bot.send_message(message.chat.id, \"Value not correct\")\n                addw_f(message)  \n        else:\n            bot.send_message(message.chat.id, \"Value not correct\")\n            addw_f(message) \n            \n    elif message.text == \"back\":\n        pass\n    else:\n        bot.send_message(message.chat.id, \"Value not correct\")\n        addw_f(message) \n\n\n# BOT Show Sleep Command \n@bot.message_handler(commands=['shows'])\ndef shows_f(message):\n    my_table = PrettyTable()\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"SELECT * FROM sleep_time\")\n    rows = cur.fetchone()\n    if rows is not None:\n        cur.execute(\"SELECT * FROM sleep_time\")\n        rows = cur.fetchall()\n        for row in rows:\n            my_table.add_row(row)\n        my_table.border = False    \n        my_table.field_names = [\"No\", \"Date\", \"Sleep time\"]\n        bot.send_message(message.chat.id, f'&lt;pre&gt;{my_table}&lt;\/pre&gt;'.format(message.chat.id, bot.get_me()), parse_mode='html')\n    else:\n        bot.send_message(message.chat.id, \"Empty Database\")\n\n\n# BOT Show Awake Command \n@bot.message_handler(commands=['showa'])\ndef send_welcome(message):\t\n    my_table = PrettyTable()\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"SELECT * FROM wakeup_time\")\n    rows = cur.fetchone()\n    if rows is not None:\n        cur.execute(\"SELECT * FROM wakeup_time\")\n        rows = cur.fetchall()\n        for row in rows:\n           my_table.add_row(row)\n        my_table.border = False      \n        my_table.field_names = [\"No\", \"Date\", \"Awake time\"]\n        bot.send_message(message.chat.id, f'&lt;pre&gt;{my_table}&lt;\/pre&gt;'.format(message.chat.id, bot.get_me()), parse_mode='html')\n    else:\n        bot.send_message(message.chat.id, \"Empty Database\")\n    \n\n# BOT Drop DB Command \n@bot.message_handler(commands=['delall'])\ndef send_welcome(message):\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"DELETE FROM sleep_time;\",)\n    cur.execute(\"DELETE FROM wakeup_time;\",)\n    cur.execute(\"DELETE FROM add_sleep;\",)\n    cur.execute(\"DELETE FROM add_wakeup;\",)\n    con.commit()\n    con.close()\n    bot.send_message(message.chat.id, \"Database erased\".format(message.chat.id, bot.get_me()), parse_mode='html')\n\n\n# BOT Delete Last Sleep Record from DB Command\n@bot.message_handler(commands=['dels'])\ndef send_welcome(message):\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"DELETE FROM add_sleep WHERE id = (SELECT MAX(id) FROM add_sleep)\")\n    cur.execute(\"DELETE FROM wakeup_time WHERE id = (SELECT MAX(id) FROM wakeup_time)\")\n    con.commit()\n    con.close()\n    bot.send_message(message.chat.id, \"Last sleep record deleted\".format(message.chat.id, bot.get_me()), parse_mode='html')\n\n# BOT Delete Last Awake Record from DB Command\n@bot.message_handler(commands=['dela'])\ndef send_welcome(message):\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"DELETE FROM add_wakeup WHERE id = (SELECT MAX(id) FROM add_wakeup)\")\n    cur.execute(\"DELETE FROM sleep_time WHERE id = (SELECT MAX(id) FROM sleep_time)\")\n    con.commit()\n    con.close()\n    bot.send_message(message.chat.id, \"Last wake up record deleted\".format(message.chat.id, bot.get_me()), parse_mode='html')\n\n\n# Function to write calculated time to sleep\ndef write_data_to_sleep(sleep_time):\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"\"\"SELECT date FROM add_sleep ORDER BY id DESC LIMIT 1\"\"\")\n    date_created =  cur.fetchone()[0]\n    cur.execute(\"\"\"INSERT INTO sleep_time (date, time) \n        VALUES (?, ?)\"\"\", (date_created, sleep_time))\n    con.commit()\n    con.close()\n\n\n# Function to write calculated time to wakeup\ndef write_data_to_wakeup(wakeup_time):\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"\"\"SELECT date FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n    date_created =  cur.fetchone()[0]\n    cur.execute(\"\"\"INSERT INTO wakeup_time (date, time) \n        VALUES (?, ?)\"\"\", (date_created, wakeup_time))\n    con.commit()\n    con.close()\n\n\n# Function to operate with times in add tables\ndef get_data_from_add_sleep():\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"\"\"SELECT hour FROM add_sleep ORDER BY id DESC LIMIT 1\"\"\")\n    sleep_last_h = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT minute FROM add_sleep ORDER BY id DESC LIMIT 1\"\"\")\n    sleep_last_m = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT hour FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n    wakeup_last_h = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT minute FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n    wakeup_last_m = int(cur.fetchone()[0])\n    sleep_time = time_calc_f.sleep_f(wakeup_last_h, wakeup_last_m, sleep_last_h, sleep_last_m)\n    write_data_to_sleep(sleep_time)\n\n\n# Function to operate with times in add tables\ndef get_data_from_add_wakeup():\n    con = sqlite3.connect('Database.db')\n    cur = con.cursor()\n    cur.execute(\"\"\"SELECT hour FROM add_sleep ORDER BY id DESC LIMIT 1\"\"\")\n    sleep_last_h = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT minute FROM add_sleep ORDER BY id DESC LIMIT 1\"\"\")\n    sleep_last_m = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT hour FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n    wakeup_last_h = int(cur.fetchone()[0])\n    cur.execute(\"\"\"SELECT minute FROM add_wakeup ORDER BY id DESC LIMIT 1\"\"\")\n    wakeup_last_m = int(cur.fetchone()[0])\n    awake_time = time_calc_f.wakeup_f(wakeup_last_h, wakeup_last_m, sleep_last_h, sleep_last_m)\n    write_data_to_wakeup(awake_time)\n        \n\nbot.polling()\n\n\n<strong>time_calc_f.py<\/strong>\n\n# Just for test uncomment to enter manualy time to calculate\n#wakeup_h = input(\"wakeup_h: \")\n#wakeup_m = input(\"wakeup_m: \")\n#sleep_h = input(\"sleep_h: \")\n#sleep_m = input(\"sleep_m: \")\n#wakeup_h = int(wakeup_h)\n#wakeup_m = int(wakeup_m)\n#sleep_h = int(sleep_h)\n#sleep_m = int(sleep_m)\n\n# Function calculates how much time pass from sleep to wakeup\ndef sleep_f(wakeup_h, wakeup_m, sleep_h, sleep_m):\n    if wakeup_h &lt; sleep_h:\n        time_in_min =(1440 - abs(((wakeup_h *60)+wakeup_m) - ((sleep_h*60)+sleep_m)))\n    else:\n        time_in_min = abs(((wakeup_h *60)+wakeup_m) - ((sleep_h*60)+sleep_m))\n    time_h = int(time_in_min\/60)\n    time_m = time_in_min - (time_h * 60)\n    sleep_time = str(time_h) + \":\" + str(time_m)\n    return(sleep_time)\n\n\n# Function calculates how much time pass from wake up to sleep\ndef wakeup_f(wakeup_h, wakeup_m, sleep_h, sleep_m):\n    if wakeup_h &gt; sleep_h:\n        time_in_min =1440 - abs(((sleep_h * 60) + sleep_m)-((wakeup_h * 60) + wakeup_m))\n    else:\n        time_in_min = abs(((sleep_h * 60) + sleep_m)-((wakeup_h * 60) + wakeup_m))\n    time_h = int(time_in_min\/60)\n    time_m = time_in_min - (time_h * 60)\n    wakeup_time = str(time_h) + \":\" + str(time_m)\n    return(wakeup_time)\n\n<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/Code.zip\">Link to code download<\/a><\/strong><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/Compiled.zip\">Link to compiled version for windows and linux download<\/a><\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Screenshots:<\/h2>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-5 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"511\" data-id=\"319\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.1.jpg\" alt=\"\" class=\"wp-image-319\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.1.jpg 977w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.1-300x157.jpg 300w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.1-768x402.jpg 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"597\" height=\"321\" data-id=\"320\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.2.jpg\" alt=\"\" class=\"wp-image-320\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.2.jpg 597w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.2-300x161.jpg 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.3.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"671\" height=\"463\" data-id=\"321\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.3.jpg\" alt=\"\" class=\"wp-image-321\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.3.jpg 671w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.3-300x207.jpg 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.4.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"167\" data-id=\"322\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.4.jpg\" alt=\"\" class=\"wp-image-322\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.4.jpg 474w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.4-300x106.jpg 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.5.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"521\" height=\"166\" data-id=\"323\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.5.jpg\" alt=\"\" class=\"wp-image-323\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.5.jpg 521w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.5-300x96.jpg 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.6.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"108\" data-id=\"324\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.6.jpg\" alt=\"\" class=\"wp-image-324\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.6.jpg 395w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.6-300x82.jpg 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.7.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"108\" data-id=\"325\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.7.jpg\" alt=\"\" class=\"wp-image-325\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.7.jpg 488w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.7-300x66.jpg 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.8.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"472\" height=\"84\" data-id=\"326\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.8.jpg\" alt=\"\" class=\"wp-image-326\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.8.jpg 472w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.8-300x53.jpg 300w\" sizes=\"auto, (max-width: 472px) 100vw, 472px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.9.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"307\" height=\"658\" data-id=\"327\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.9.jpg\" alt=\"\" class=\"wp-image-327\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.9.jpg 307w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.9-140x300.jpg 140w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.10.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"310\" height=\"641\" data-id=\"328\" src=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.10.jpg\" alt=\"\" class=\"wp-image-328\" srcset=\"https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.10.jpg 310w, https:\/\/sznetwork.systems\/wp-content\/uploads\/2021\/11\/screenshot.10-145x300.jpg 145w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is small self hosted Telegram Bot written on python to save baby sleep and awake time. Based on python app SZ_BabySWTime. For time saving uses SQLite database.Main function is. <a class=\"read-more-link\" href=\"https:\/\/sznetwork.systems\/?page_id=283\">read more&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":178,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-283","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/pages\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283"}],"version-history":[{"count":12,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/pages\/283\/revisions"}],"predecessor-version":[{"id":1893,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/pages\/283\/revisions\/1893"}],"up":[{"embeddable":true,"href":"https:\/\/sznetwork.systems\/index.php?rest_route=\/wp\/v2\/pages\/178"}],"wp:attachment":[{"href":"https:\/\/sznetwork.systems\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}