Skip to content

Instantly share code, notes, and snippets.

@demmer
Created July 28, 2015 16:45
Show Gist options
  • Save demmer/3c37675f9810b75df6c7 to your computer and use it in GitHub Desktop.
Save demmer/3c37675f9810b75df6c7 to your computer and use it in GitHub Desktop.
silly twitter analytics
// silly little juttle that compares the twitterati
(
emit -limit 1 | put name='demmer', tweets=12, followers=33, first_tweet=:2015-06-02:;
emit -limit 1 | put name='apurva', tweets=81, followers=71, first_tweet=:2002-06-18:;
emit -limit 1 | put name='henri', tweets=121, followers=61, first_tweet=:2007-12-31:;
)
| put followers_per_day = Duration.get(:now: - first_tweet, "days")
| put followers_per_tweet = followers / tweets
|(
@barchart -title "Followers" -valueField 'followers' -categoryField 'name';
@barchart -title "Followers per day" -valueField 'followers_per_day' -categoryField 'name';
@barchart -title "Followers per tweet" -valueField 'followers_per_tweet' -categoryField 'name';
@table
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment