twords 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -4
- data/lib/twords.rb +2 -2
- data/lib/twords/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27f1c65684b3af0b7d96a2987c5d597e1a3e2049
|
4
|
+
data.tar.gz: 332a52d200691a188ec34d8e902e71c033f64e3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1419af30473aa0c1dd9f831515c1a5f1a1c8e37cb9f18cdb482fc18bbd7a86d7144fc5e9e01a5d6c2d5b80c586dfc8b64bec18bc8a69f692c0e3520ec7118c6c
|
7
|
+
data.tar.gz: 4418803ab8a1ba929f274e0897bcdf22a2266757aff02e7b63e6bc55fc62a08f28e2d05c1b50a8c83563669eb438efa4be73542fdcdae75cff5a81c50e8d675c
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
![twords](
|
1
|
+
![twords](http://msimonborg.com/twords/twords.png)
|
2
2
|
|
3
3
|
## Twitter word clouds
|
4
4
|
|
@@ -24,9 +24,14 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
Twords.config do |config|
|
27
|
-
config.rejects = %w[the for and
|
28
|
-
config.range = 14
|
29
|
-
|
27
|
+
config.rejects = %w[are this is from be on the for to and at our of in rt a with &] # these words will not be counted (example, not a default; you must provide your own list)
|
28
|
+
config.range = 14 # number of days to check, no default
|
29
|
+
|
30
|
+
config.include_hashtags = false # default, excludes words beginning with '#'
|
31
|
+
config.include_uris = false # default, uses URI#regexp to match
|
32
|
+
config.include_mentions = false # default, excludes words beginning with '@'
|
33
|
+
|
34
|
+
config.up_to { Time.now } # The block must return an object that responds to #to_time. The time is lazy evaluated and the range is counted backward from here.
|
30
35
|
|
31
36
|
config.twitter_client do |twitter|
|
32
37
|
twitter.consumer_key = YOUR_TWITTER_CONSUMER_KEY
|
data/lib/twords.rb
CHANGED
@@ -101,7 +101,7 @@ class Twords
|
|
101
101
|
|
102
102
|
def hashtag?(word)
|
103
103
|
return false if self.class.include_hashtags
|
104
|
-
word.match?(
|
104
|
+
word.match?(/#(\w+)/)
|
105
105
|
end
|
106
106
|
|
107
107
|
def uri?(word)
|
@@ -111,7 +111,7 @@ class Twords
|
|
111
111
|
|
112
112
|
def mention?(word)
|
113
113
|
return false if self.class.include_mentions
|
114
|
-
word.match?(
|
114
|
+
word.match?(/@(\w+)/)
|
115
115
|
end
|
116
116
|
|
117
117
|
def hashtags
|
data/lib/twords/version.rb
CHANGED