MalcolmWilliams / Laser-Writer

A laser writer that uses mirror galvonometers to control a laser beam and write tweets on distant objects
http://rekon.xyz/Laser-Writer/
Other
0 stars 0 forks source link

Unknown crash #7

Closed MalcolmWilliams closed 7 years ago

MalcolmWilliams commented 7 years ago

This tweet crashed the program: {"contributors": null, "truncated": false, "text": "I write Barack Obama and left Barack Obama @BarackObama", "is_quote_status": false, "in_reply_to_status_id": null, "id": 799061772913082369, "favorite_count": 0, "entities": {"symbols": [], "user_mentions": [{"id": 813286, "indices": [43, 55], "id_str": "813286", "screen_name": "BarackObama", "name": "Barack Obama"}], "hashtags": [], "urls": []}, "retweeted": false, "coordinates": null, "source": "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Mobile Web (M2)</a>", "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "retweet_count": 0, "id_str": "799061772913082369", "favorited": false, "user": {"follow_request_sent": false, "has_extended_profile": false, "profile_use_background_image": false, "default_profile_image": false, "id": 2321140004, "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "verified": false, "translator_type": "none", "profile_text_color": "000000", "profile_image_url_https": "https://pbs.twimg.com/profile_images/713154733528195072/Bju1eAua_normal.jpg", "profile_sidebar_fill_color": "000000", "entities": {"url": {"urls": [{"url": "https://t.co/LlBiQEYDmV", "indices": [0, 23], "expanded_url": "https://www.youtube.com/channel/UCcyxl8fUhwGz_BvCPj874Wg", "display_url": "youtube.com/channel/UCcyxl\u2026"}]}, "description": {"urls": []}}, "followers_count": 21, "profile_sidebar_border_color": "000000", "id_str": "2321140004", "profile_background_color": "000000", "listed_count": 0, "is_translation_enabled": false, "utc_offset": null, "statuses_count": 302, "description": "", "friends_count": 140, "location": "", "profile_link_color": "1B95E0", "profile_image_url": "http://pbs.twimg.com/profile_images/713154733528195072/Bju1eAua_normal.jpg", "following": false, "geo_enabled": false, "profile_banner_url": "https://pbs.twimg.com/profile_banners/2321140004/1460155758", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "screen_name": "coelhinho1258", "lang": "pt", "profile_background_tile": false, "favourites_count": 16, "name": "The Minecraft", "notifications": false, "url": "https://t.co/LlBiQEYDmV", "created_at": "Fri Jan 31 17:41:20 +0000 2014", "contributors_enabled": false, "time_zone": null, "protected": false, "default_profile": false, "is_translator": false}, "geo": null, "in_reply_to_user_id_str": null, "lang": "en", "created_at": "Thu Nov 17 01:29:07 +0000 2016", "in_reply_to_status_id_str": null, "place": null, "metadata": {"iso_language_code": "en", "result_type": "recent"}}

Log:


Selecting a new random tweet
There are 55 tweets in the pool
Random tweet selected: 799061772913082369
Output: I write Barack Obama and left Barack Obama @BarackObama
Traceback (most recent call last):
  File "main.py", line 87, in <module>
    lw.demo()
  File "main.py", line 66, in demo
    self.write_tweet(5)
  File "main.py", line 38, in write_tweet
    t = threading.Thread(target = self.od.write_tweet(tweet, time_display))
  File "/home/malcolm/Coding/Khazanah/Laser-Projector/openlase/Openlase_Driver.py", line 48, in write_tweet
    tweet_segments = self.segment_message(tweet_string)
  File "/home/malcolm/Coding/Khazanah/Laser-Projector/openlase/Openlase_Driver.py", line 89, in segment_message
    tweet_segments.append(self.get_tweet_string(tweet_words, count))
  File "/home/malcolm/Coding/Khazanah/Laser-Projector/openlase/Openlase_Driver.py", line 104, in get_tweet_string
    tweet_string = tweet_string + " " + tweet_words[i]
IndexError: list index out of range```
MalcolmWilliams commented 7 years ago

Was not properly resetting the count variable in the tweet selection algorithm