LATEST CLUCCS
+ Latest Cluccs +
+ diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc new file mode 100644 index 0000000..fa27820 Binary files /dev/null and b/__pycache__/dashboard.cpython-310.pyc differ diff --git a/dashboard.py b/dashboard.py index 5d7e0d0..7b8637f 100644 --- a/dashboard.py +++ b/dashboard.py @@ -12,7 +12,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="sample") + start_offline_tweets('sports1.txt', event_name="tweet", time_factor=0.1) ctx.count = 0 # fire('sample', {'previous': 0.0}) @@ -21,21 +21,14 @@ def setup(ctx, e): def clip(lower, value, upper): return max(lower, min(value, upper)) -@event('sample') -def generate_sample(ctx, e): - ctx.count += 1 - if ctx.count % 50 == 0: - emit('debug', {'text': 'Log message #'+str(ctx.count)+'!'}) +@event('tweet') +def generate_tweet(ctx, e): tweet = e.data - # print(tweet) # base sample on previous one # sample = clip(-100, e.data['previous'] + random.uniform(+5.0, -5.0), 100) # emit to outside world - emit('sample',{ - 'action': 'add', - 'value': tweet - }) + emit('tweet', tweet) - # chain event - fire('sample', {'previous': tweet}, delay=0.05) + # # chain event + # fire('tweet', {'previous': tweet}, delay=0.05) diff --git a/dashboard_static/index.html b/dashboard_static/index.html index 1269f40..68148e7 100644 --- a/dashboard_static/index.html +++ b/dashboard_static/index.html @@ -6,6 +6,7 @@
+