twitter_with_auto_pagination 0.8.9 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb92903cd356cc3a2e573600f5360bdcbee36b58
|
4
|
+
data.tar.gz: 665e727c7a707d1e034423008c96497801a2fd22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c897c8db06c84858332329680f9a526bf6e6483191894d511920923ebd2192ac3961575c22fa2f067bb7d7a7389403d64a4e561e500ee3ffb2fc7a94836f7e8a
|
7
|
+
data.tar.gz: 8243470f15fe20adcb12347e2e1b1edd52230f00d3ec763a076840a358f7d8a699add0440b06aab4bb63b5a63331d888f926c2f17ad9d9f46a619eb79846421a
|
@@ -116,20 +116,13 @@ module TwitterWithAutoPagination
|
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def usage_stats(
|
120
|
-
n_days_ago = options.has_key?(:days) ? options[:days].days.ago : 100.years.ago
|
121
|
-
tweets = options.has_key?(:tweets) ? options.delete(:tweets) : user_timeline(user)
|
122
|
-
day_names = options.has_key?(:day_names) ? options.delete(:day_names) : %w(Sun Mon Tue Wed Thu Fri Sat)
|
123
|
-
times =
|
124
|
-
# TODO Use user specific time zone
|
125
|
-
tweets.map { |t| ActiveSupport::TimeZone['Tokyo'].parse(t.created_at.to_s) }.
|
126
|
-
select { |t| t > n_days_ago }
|
119
|
+
def usage_stats(tweet_times, day_names: %w(Sun Mon Tue Wed Thu Fri Sat))
|
127
120
|
[
|
128
|
-
usage_stats_wday_series_data(
|
129
|
-
usage_stats_wday_drilldown_series(
|
130
|
-
usage_stats_hour_series_data(
|
131
|
-
usage_stats_hour_drilldown_series(
|
132
|
-
twitter_addiction_series(
|
121
|
+
usage_stats_wday_series_data(tweet_times, day_names: day_names),
|
122
|
+
usage_stats_wday_drilldown_series(tweet_times, day_names: day_names),
|
123
|
+
usage_stats_hour_series_data(tweet_times),
|
124
|
+
usage_stats_hour_drilldown_series(tweet_times, day_names: day_names),
|
125
|
+
twitter_addiction_series(tweet_times, day_names: day_names)
|
133
126
|
]
|
134
127
|
end
|
135
128
|
end
|