twitter_with_auto_pagination 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dc8b7e411aacd1368c185e91b0ce3639a98a7fa
|
4
|
+
data.tar.gz: 82c7e2b1e7ccffb6fd834227af7a723c4f11e2f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 978e0d5023163d376eb8b10c56ef10ac542f7e7d1e29656abbc20e23ebf5cfcf86cad6480c3e9b5273d12cbc1172fa77402ead345e2f10bab8fd193a8d298422
|
7
|
+
data.tar.gz: 2c04bcac90233c24cc2ada868474a3a453406f8194ad09154b6e980ee1b54dd5b5ac9939c7add88d03762de75988d70683e3820526bab03313d63f1fb506a508
|
@@ -50,7 +50,7 @@ module TwitterWithAutoPagination
|
|
50
50
|
tweets = tweets.select { |t| t.text && t.text.include?('#') }
|
51
51
|
puts "tweets with hashtag: #{tweets.size}" if debug
|
52
52
|
|
53
|
-
hashtags = tweets.map { |t| t.text.scan(/[##][A-Za-zA-Za-
|
53
|
+
hashtags = tweets.map { |t| t.text.scan(/[##][A-Za-zA-Za-z_一-鿆0-90-9ぁ-ヶヲ-゚ー]+/).map(&:strip) }.flatten
|
54
54
|
puts "hashtags: #{hashtags.size}" if debug
|
55
55
|
|
56
56
|
hashtags.each_with_object(Hash.new(0)) { |h, memo| memo[h] += 1 }.sort_by { |k, v| [-v, -k.size] }.slice(0, limit).to_h
|