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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e73e51822890ec3d5333a74fd2dcd25cb433394
4
- data.tar.gz: 0255ff95f17eef5ae53c56c156646a98134997f6
3
+ metadata.gz: 6e2731e4ea154dedfaed9d038118fbac7939ba4e
4
+ data.tar.gz: aaeacce0feb3eb9c3922a6ecd2cb15b8b55bdc1b
5
5
  SHA512:
6
- metadata.gz: f811bbb8d2c24a4b53c93ed7d3d2e517fee9e8e966b85562fdbf17c6d514ac5cc2699923ca11fe404aca6a4caa9b2cdbbd5496480d7bd76fe14f763b99c1ad93
7
- data.tar.gz: feb5ef50129e4dd00ab490ac032143d76619a78662de7ad80567df0d0679b81aa54a0deb24ce22c295add93690e76aab599705c4f88fe732f8b0ada5a452da77
6
+ metadata.gz: 5ce5575437568cc6aca41db94cf1283428224a518b6dec77737254e88f232d77a6bae70dcec5d442b61f731941e6c80a77f572a2b623655dc2216a9d1fa3318d
7
+ data.tar.gz: 860e0c79ebc831b113afa7aa945f54d8ce5da8db08541d1c857509f813c03d99ab6fdd8c5c2aaed970c94c346dc877cc3314c7746ab9542d19a657a7bcb657c7
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
- # TweetBan
1
+ # TweetWatch
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tweet_watch`. To experiment with that code, run `bin/console` for an interactive prompt.
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
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
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/[USERNAME]/tweet_ban. 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.
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
@@ -27,7 +27,3 @@ tweeters:
27
27
  - jaketapper
28
28
  - lodr_io
29
29
  - newsycombinator
30
-
31
- monitor:
32
- interval: 10
33
- account_timeline_history: 100
@@ -95,15 +95,16 @@ module TweetWatch
95
95
  elsif obj.class == Twitter::Streaming::StallWarning
96
96
  warn "Falling behind!"
97
97
  else
98
- puts "untracked tweet obj #{obj.class}".colorize(color: :black, background: :light_white)
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: "-hn", desc: "When started Monitor will collect 200 tweets by defaul for each tweeter."
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)
@@ -12,7 +12,7 @@ module TweetWatch
12
12
  end
13
13
 
14
14
  def load_from_path(path)
15
- unless File.exists?(path)
15
+ unless File.exist?(path)
16
16
  raise ArgumentError.new("The provided config file could not be located: #{path}")
17
17
  end
18
18
 
@@ -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}.merge(options)
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?
@@ -1,3 +1,3 @@
1
1
  module TweetWatch
2
- VERSION = "0.2.3.pre"
2
+ VERSION = "0.2.3"
3
3
  end
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.pre
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-21 00:00:00.000000000 Z
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: 1.3.1
143
+ version: '0'
143
144
  requirements: []
144
145
  rubyforge_project:
145
146
  rubygems_version: 2.5.1