lesser-evil 0.2.2 → 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/LICENSE +8 -0
- data/README.md +18 -1
- data/lib/lesser_evil/command_line_interface.rb +1 -1
- data/lib/lesser_evil/tweet_controller.rb +2 -0
- data/lib/lesser_evil/tweet_slim.rb +2 -2
- data/lib/lesser_evil/version.rb +1 -1
- data/spec.md +3 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7908aa827f9e75bc14bf3212711fd213d0133a05
|
4
|
+
data.tar.gz: bb046caf1d70c37d67ae43c19e84943285e5a235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f1b4ea30f73ca89df7b90c43dc34dea1e45a2bcb4f59a6b4dab0499b2199af499a294be3b1766f5f755f82422fd94dae83a7571454b26717081871437986cbc
|
7
|
+
data.tar.gz: d4661ae4aab855714c7d65ea5b33c8683f2c96bebdf2362478daa999463492c2d7d2db8a841ed2604ed38b17ff0a7bb2ab0d8a6577581c4a26f0bcce7b5ad270
|
data/LICENSE
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2016 Adam Cooper
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
5
|
+
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# Lesser Evil
|
2
|
+
**Lesser Evil** is a command line gem that allows the user to view tweets around the recent U.S. presidential election. Lesser Evil presents the user with a choice of candidates (Trump and Clinton) and of sentiments (angry or very angry). It then finds recent tweets about the chosen candidate, filters them through a sentiment analysis engine, and returns the angry or very angry tweets to the screen.
|
3
|
+
|
4
|
+
Lesser Evil uses the [Twitter Search API](https://dev.twitter.com/rest/public/search) and [Vivek Narayanan's sentiment analysis tool](http://sentiment.vivekn.com/about/). Mr Narayanan's tool is not perfect. It returns a value of positive, negative, or neutral for each input text, and also a confidence number between 0 and 100. Sometimes, though, you ask for very angry tweets and what you get is not angry at all.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
Installation is simple. Install the gem on your hard drive
|
8
|
+
|
9
|
+
gem install lesser-evil
|
10
|
+
and then run it with the following command:
|
11
|
+
|
12
|
+
lesser-evil-cli
|
13
|
+
|
14
|
+
## Contributors guide
|
15
|
+
Go ahead and make a pull request!
|
16
|
+
|
17
|
+
## License
|
18
|
+
[MIT](https://github.com/amcooper/lesser-evil-cli-app/blob/master/LICENSE)
|
@@ -33,6 +33,8 @@ class LesserEvil::TweetController
|
|
33
33
|
index = 0
|
34
34
|
while index < batch.length && @result.length < @tweet_qty
|
35
35
|
status = batch[index]
|
36
|
+
|
37
|
+
# Filter out retweets
|
36
38
|
if status["retweeted_status"] == nil || (!@result.collect {|tweet_slim| tweet_slim.orig_id}.include?(status["retweeted_status"]["id"]) && !@result.collect {|tweet_slim| tweet_slim.orig_id}.include?(status["id"]))
|
37
39
|
sentiment_analysis = get_sentiment(status["text"])
|
38
40
|
intensity = @is_intense ? 1 : 0
|
data/lib/lesser_evil/version.rb
CHANGED
data/spec.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Specifications for the CLI Assessment
|
2
2
|
|
3
3
|
Specs:
|
4
|
-
- [x] Have a CLI for interfacing with the application
|
5
|
-
- [x] Pull data from an external source
|
6
|
-
- [
|
4
|
+
- [x] Have a CLI for interfacing with the application : /lib/lesser_evil/command_line_interface.rb
|
5
|
+
- [x] Pull data from an external source : Twitter Search API and Vivek Narayanan's sentiment analysis tool
|
6
|
+
- [x] Implement both list and detail views : In a manner of speaking. You choose a candidate. Then you choose an intensity of negativity ('angry' or 'very angry'). Then the application finds tweets about your chosen candidate and filters those with the chosen sentiment.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lesser-evil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooper
|
@@ -119,6 +119,7 @@ extensions: []
|
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
121
|
- Gemfile
|
122
|
+
- LICENSE
|
122
123
|
- README.md
|
123
124
|
- bin/lesser-evil-cli
|
124
125
|
- lib/assets/donald.txt
|