|
115 | 115 | if timestamp.startswith(current_time.text[0 : 10]): |
116 | 116 | print("match") |
117 | 117 | # grabs the hour of the tweet timestamp |
118 | | - tweet_hour = int(timestamp[11:12]) |
| 118 | + tweet_hour = int(timestamp[11:13]) |
119 | 119 | print(tweet_hour) |
120 | 120 | # grabs the current hour |
121 | | - current_hour = int(current_time.text[11:12]) |
| 121 | + current_hour = int(current_time.text[11:13]) |
122 | 122 | print(current_hour) |
123 | 123 | # if it's been less than an hour since the tweet... |
124 | | - if abs(current_hour - tweet_hour) < 2: |
| 124 | + if abs(current_hour - tweet_hour) < 1: |
125 | 125 | print("in the last hour") |
126 | 126 | # displays tweet text and time on screen |
127 | 127 | text_area.text = "\n".join(wrap_text_to_lines(stock_check, 21)) |
|
131 | 131 | alarm_out.value = True |
132 | 132 |
|
133 | 133 | else: |
134 | | - pass |
135 | | - # if the tweet wasn't today |
136 | | - else: |
137 | | - # if it's not new, then the wait continues |
138 | | - no_tweet_text = ("No stock in last hour :( Last stock: %s" % (timestamp)) |
139 | | - text_area.text = "\n".join(wrap_text_to_lines(no_tweet_text, 21)) |
140 | | - print("no new in stock notifications :(") |
141 | | - |
| 134 | + # if it's not new, then the wait continues |
| 135 | + no_tweet_text = ("No stock in last hour :( Last stock: %s" % (timestamp)) |
| 136 | + text_area.text = "\n".join(wrap_text_to_lines(no_tweet_text, 21)) |
| 137 | + print("no new in stock notifications :(") |
142 | 138 | # updates tweet ID |
143 | 139 | last_value = value |
| 140 | + # if the tweet wasn't today |
| 141 | + else: |
| 142 | + # if it's not new, then the wait continues |
| 143 | + no_tweet_text = ("No stock in last hour :( Last stock: %s" % (timestamp)) |
| 144 | + text_area.text = "\n".join(wrap_text_to_lines(no_tweet_text, 21)) |
| 145 | + print("no new in stock notifications :(") |
0 commit comments