diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc index 986186a..719b88d 100644 Binary files a/__pycache__/dashboard.cpython-310.pyc and b/__pycache__/dashboard.cpython-310.pyc differ diff --git a/dashboard.py b/dashboard.py index 6fb5a52..3e356ac 100644 --- a/dashboard.py +++ b/dashboard.py @@ -13,7 +13,7 @@ root_content_path = 'dashboard_static' # the action will be called with the context and the event @event('init') def setup(ctx, e): - start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.1) + start_offline_tweets('sports1.txt', event_name="tweet", time_factor=1) ctx.count = 0 # fire('sample', {'previous': 0.0}) @@ -40,7 +40,58 @@ def words(message): @event('tweet') def generate_tweet(ctx, e): - tweet = e.data + tweet = dict(e.data) + try: + try: + tweet.pop("id_str") + except KeyError: + pass + try: + tweet.pop("display_text_range") + except KeyError: + pass + try: + tweet.pop("in_reply_to_status_id") + except KeyError: + pass + try: + tweet.pop("in_reply_to_status_id_str") + except KeyError: + pass + try: + tweet.pop("in_reply_to_user_id") + except KeyError: + pass + try: + tweet.pop("in_reply_to_user_id_str") + except KeyError: + pass + try: + tweet.pop("in_reply_to_screen_name") + except KeyError: + pass + try: + tweet.pop("geo") + except KeyError: + pass + try: + tweet.pop("coordinates") + except KeyError: + pass + try: + tweet.pop("place") + except KeyError: + pass + try: + tweet.pop("contributors") + except KeyError: + pass + try: + tweet.pop("is_quote_status") + except KeyError: + pass + except: + pass # base sample on previous one # sample = clip(-100, e.data['previous'] + random.uniform(+5.0, -5.0), 100) # emit to outside world diff --git a/dashboard_static/js/code.js b/dashboard_static/js/code.js index 64747fb..df51121 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -32,8 +32,6 @@ function tweetCell(tweet) {
${tweet.text}