tweet_watch 0.2.3.pre → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +53 -5
- data/config.yml +0 -4
- data/lib/tweet_watch/cli.rb +4 -3
- data/lib/tweet_watch/config.rb +1 -1
- data/lib/tweet_watch/monitor.rb +4 -2
- data/lib/tweet_watch/version.rb +1 -1
- data/timeline_streaming.png +0 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e2731e4ea154dedfaed9d038118fbac7939ba4e
|
4
|
+
data.tar.gz: aaeacce0feb3eb9c3922a6ecd2cb15b8b55bdc1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ce5575437568cc6aca41db94cf1283428224a518b6dec77737254e88f232d77a6bae70dcec5d442b61f731941e6c80a77f572a2b623655dc2216a9d1fa3318d
|
7
|
+
data.tar.gz: 860e0c79ebc831b113afa7aa945f54d8ce5da8db08541d1c857509f813c03d99ab6fdd8c5c2aaed970c94c346dc877cc3314c7746ab9542d19a657a7bcb657c7
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# TweetWatch
|
2
2
|
|
3
|
-
|
3
|
+
TweetWatch can be used to collect timeline data from several accounts and from specific twitter users. The primary motivation for creating this gem was to track the home timeline of several accounts and study how and when tweets appear in an accounts timeline. Is shadow banning real?
|
4
4
|
|
5
|
-
|
5
|
+
This gem is designed to be used as CLI tool but is not a full fledged alternative to the [twitter CLI](https://github.com/sferik/t). The primary goal of this gem is to collect twitter data perodically.
|
6
|
+
|
7
|
+
![Image of TweetWatch timeline streaming](https://raw.githubusercontent.com/ajoabraham/tweet_watch/master/timeline_streaming.png)
|
6
8
|
|
7
9
|
## Installation
|
8
10
|
|
@@ -20,9 +22,55 @@ Or install it yourself as:
|
|
20
22
|
|
21
23
|
$ gem install tweet_watch
|
22
24
|
|
25
|
+
## Configuration
|
26
|
+
|
27
|
+
All CLI commands require a configuration file. The config file has two major sections **accounts** and **tweeters**. Tweeters are the accounts you want to track. This is optional and will cause the csv output to only contain tweets from one of these users. Accounts is where you define access to a twitter account. More on that below.
|
28
|
+
|
29
|
+
See example [config.yml](config.yml).
|
30
|
+
|
31
|
+
## Account Authorization
|
32
|
+
|
33
|
+
To give TweetWatch access to your home timeline, register a twitter app and enter the accounts credentials in your config file.
|
34
|
+
1. Go to [Twitter Apps Site](https://apps.twitter.com/)
|
35
|
+
2. Click on "Create a New App", if you don't already have one. (You can have more than one)
|
36
|
+
3. In your App, click on the "Keys and Access Tokens" tab
|
37
|
+
4. Scroll down and generate access token and secret
|
38
|
+
5. Add an account to your config file as shown in the [example](config.yml). For each account enter the screen name, consumer key, consumer secret, access token, access secret
|
39
|
+
|
40
|
+
Now you're ready to use tweet_watch
|
41
|
+
|
23
42
|
## Usage
|
24
43
|
|
25
|
-
|
44
|
+
Get the last 50 tweets in an accounts home timeline:
|
45
|
+
|
46
|
+
```sh
|
47
|
+
tweet_watch timeline -c config.yml
|
48
|
+
```
|
49
|
+
|
50
|
+
Get the last 100 twets for a specfic account in your config file:
|
51
|
+
|
52
|
+
```sh
|
53
|
+
tweet_watch timeline -c config.yml -n 100 -u ajoabraham
|
54
|
+
```
|
55
|
+
|
56
|
+
Instead of printing out a timeline stream it:
|
57
|
+
|
58
|
+
```sh
|
59
|
+
tweet_watch timeline -c config.yml -s
|
60
|
+
```
|
61
|
+
|
62
|
+
Stream a timeline and record to a CSV file tweets from specific users. Tweeters list can be provided from the command line or read in from the Config file:
|
63
|
+
|
64
|
+
```sh
|
65
|
+
tweet_watch watch -c config.yml -t user1 user2 user3
|
66
|
+
```
|
67
|
+
|
68
|
+
Monitor the home timeline of configured accounts while also recording the tweets sent by the provided list of tweeters:
|
69
|
+
```sh
|
70
|
+
tweet_watch monitor -c config.yml
|
71
|
+
```
|
72
|
+
|
73
|
+
The monitor command by default will run every 15 minutes but you can provide a different interval by passing _-i_ command with your desired time in seconds. This will create a tweeter_tweets.csv and account_timeline.csv file. Comparing the data in these files we should be able to determine how and when tweets will get propagated into home timelines of target accounts.
|
26
74
|
|
27
75
|
## Development
|
28
76
|
|
@@ -32,7 +80,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
80
|
|
33
81
|
## Contributing
|
34
82
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
83
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ajoabraham/tweet_watch. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
84
|
|
37
85
|
|
38
86
|
## License
|
data/config.yml
CHANGED
data/lib/tweet_watch/cli.rb
CHANGED
@@ -95,15 +95,16 @@ module TweetWatch
|
|
95
95
|
elsif obj.class == Twitter::Streaming::StallWarning
|
96
96
|
warn "Falling behind!"
|
97
97
|
else
|
98
|
-
|
98
|
+
# do nothing for now
|
99
|
+
#puts "untracked tweet obj #{obj.class}".colorize(color: :black, background: :light_white)
|
99
100
|
end
|
100
101
|
|
101
102
|
end
|
102
103
|
end
|
103
104
|
|
104
105
|
desc "monitor", "Monitors target tweeters tweets and provided account timelines."
|
105
|
-
option :interval, aliases: "-i", desc: "Time delay between each monitoring run. Default = 15 mins."
|
106
|
-
option :initial_tweet_history, aliases: "-
|
106
|
+
option :interval, aliases: "-i", desc: "Time delay in seconds between each monitoring run. Default = 15 mins."
|
107
|
+
option :initial_tweet_history, aliases: "-h", desc: "When started Monitor will collect 200 tweets by defaul for each tweeter."
|
107
108
|
option :timeline_count, aliases: "-n", desc: "For each monitor run, how many tweets should be collected. 200 by default is also the max."
|
108
109
|
def monitor
|
109
110
|
load_config(options)
|
data/lib/tweet_watch/config.rb
CHANGED
data/lib/tweet_watch/monitor.rb
CHANGED
@@ -12,8 +12,10 @@ module TweetWatch
|
|
12
12
|
def initialize(options = {})
|
13
13
|
@options = {interval: (15*60),
|
14
14
|
initial_tweet_history: 200,
|
15
|
-
timeline_count: 200}
|
16
|
-
|
15
|
+
timeline_count: 200}
|
16
|
+
@options.merge!(Hash[options.map{ |k, v| [k.to_sym, v] }])
|
17
|
+
@options[:interval] = @options[:interval].to_i
|
18
|
+
|
17
19
|
@new_tweeter_tweets = 0
|
18
20
|
|
19
21
|
if TweetWatch.config.tweeters.empty?
|
data/lib/tweet_watch/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tweet_watch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.3
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajo Abraham
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- lib/tweet_watch/monitor.rb
|
122
122
|
- lib/tweet_watch/utils.rb
|
123
123
|
- lib/tweet_watch/version.rb
|
124
|
+
- timeline_streaming.png
|
124
125
|
- tweet_watch.gemspec
|
125
126
|
homepage: http://rubygems.org/gems/tweet_watch
|
126
127
|
licenses:
|
@@ -137,9 +138,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
138
|
version: '0'
|
138
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
140
|
requirements:
|
140
|
-
- - "
|
141
|
+
- - ">="
|
141
142
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
143
|
+
version: '0'
|
143
144
|
requirements: []
|
144
145
|
rubyforge_project:
|
145
146
|
rubygems_version: 2.5.1
|