adncv 0.3 → 0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +28 -6
- data/lib/ADNCV/data.rb +12 -3
- data/lib/ADNCV/display.rb +8 -2
- data/lib/ADNCV/version.rb +1 -1
- data/lib/ADNCV.rb +1 -0
- 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: 6b240d2b88fc0750e717354a51149cdd9c2cea31
|
4
|
+
data.tar.gz: edff5c392d2afa3cda914313256fa29d7084e57f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d69ebc3988d957f7ce8b1f324f4005b3772439abc87e1d811ece7c4cac84dad0981c4fcf22fbe7494a1be6de65b6104e832b2a13681a2f92ebb6418311fdb0
|
7
|
+
data.tar.gz: 4baaad2c56a997471b09d02bd86524b6122f78f6aec6b214c39e772fd7dfea1b441aedb1a1c761eab87c31a1f0cc2032df4ae0a2b1f2a54911ffa9e6018755a7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -12,9 +12,7 @@ Statistics from your App.net data.
|
|
12
12
|
|
13
13
|
3. Run the Gem on the downloaded file:
|
14
14
|
|
15
|
-
|
16
|
-
adncv -d /path/to/appdotnet-data-you-xxxxx-posts.json
|
17
|
-
```
|
15
|
+
`adncv -d /path/to/appdotnet-data-you-xxxxx-posts.json`
|
18
16
|
|
19
17
|
## Commands
|
20
18
|
|
@@ -24,12 +22,36 @@ adncv -d /path/to/appdotnet-data-you-xxxxx-posts.json
|
|
24
22
|
|
25
23
|
Displays informations.
|
26
24
|
|
27
|
-
Add `-f` for full details (
|
25
|
+
Add `-f` for full details (posted links, mentioned users, posts per month, etc):
|
26
|
+
|
27
|
+
`adncv -d -f posts.json`
|
28
28
|
|
29
29
|
### Export
|
30
30
|
|
31
31
|
`adncv -e posts.json`
|
32
32
|
|
33
|
-
Exports informations as a JSON file, including
|
33
|
+
Exports informations as a JSON file, including full details.
|
34
|
+
|
35
|
+
Add `-p` to specify the destination folder path (default: ~):
|
36
|
+
|
37
|
+
`adncv -e posts.json -p ~/Documents`
|
38
|
+
|
39
|
+
## Content
|
40
|
+
|
41
|
+
ADNCV will display/export:
|
34
42
|
|
35
|
-
|
43
|
+
- total posts
|
44
|
+
- posts without mentions
|
45
|
+
- posts directed to a user
|
46
|
+
- posts containing mentions but not directed
|
47
|
+
- posts containing mentions and are replies
|
48
|
+
- posts containing mentions and are not replies
|
49
|
+
- posts containing links
|
50
|
+
- times your posts have been reposted
|
51
|
+
- times your posts have been starred
|
52
|
+
- times your posts have been replied
|
53
|
+
- list of users you've posted directly to
|
54
|
+
- list of users you've mentioned
|
55
|
+
- list of clients you've posted with
|
56
|
+
- all your posted links
|
57
|
+
- your monthly posting frequency
|
data/lib/ADNCV/data.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
module ADNCV
|
3
3
|
class Data
|
4
4
|
|
5
|
-
attr_reader :filename, :count, :leadings, :without_mentions, :mentions_not_directed, :replies, :mentions_not_replies, :with_links, :sources, :all_links, :directed_users, :names, :clients, :mentions, :all_clients, :all_mentioned, :reposts, :stars
|
5
|
+
attr_reader :filename, :count, :leadings, :without_mentions, :mentions_not_directed, :replies, :mentions_not_replies, :with_links, :sources, :all_links, :directed_users, :names, :clients, :mentions, :all_clients, :all_mentioned, :reposts, :stars, :been_replied, :freq
|
6
6
|
attr_accessor :export_path
|
7
7
|
|
8
8
|
def initialize
|
@@ -21,10 +21,12 @@ module ADNCV
|
|
21
21
|
@with_links = 0
|
22
22
|
@reposts = 0
|
23
23
|
@stars = 0
|
24
|
+
@been_replied = 0
|
24
25
|
mentioned = Hash.new(0)
|
25
26
|
directed = Hash.new(0)
|
26
27
|
is_reply = Hash.new(0)
|
27
28
|
@clients = Hash.new(0)
|
29
|
+
@freq = Hash.new(0)
|
28
30
|
|
29
31
|
decoded.each do |post|
|
30
32
|
@clients[post["source"]["name"]] += 1
|
@@ -57,6 +59,11 @@ module ADNCV
|
|
57
59
|
unless post["num_stars"].nil?
|
58
60
|
@stars += post["num_stars"]
|
59
61
|
end
|
62
|
+
unless post["num_replies"].nil?
|
63
|
+
@been_replied += post["num_replies"]
|
64
|
+
end
|
65
|
+
dd = Date.parse(post["created_at"])
|
66
|
+
@freq[[dd.year, dd.month]] += 1
|
60
67
|
end
|
61
68
|
|
62
69
|
all_directed = directed.sort_by {|k,v| v}
|
@@ -100,7 +107,9 @@ module ADNCV
|
|
100
107
|
with_mentions_are_not_replies: @mentions_not_replies,
|
101
108
|
with_links: @with_links,
|
102
109
|
have_been_reposted: @reposts,
|
103
|
-
have_been_starred: @stars
|
110
|
+
have_been_starred: @stars,
|
111
|
+
have_been_replied: @been_replied,
|
112
|
+
posts_per_month: @freq
|
104
113
|
}]
|
105
114
|
},
|
106
115
|
users: {
|
@@ -118,7 +127,7 @@ module ADNCV
|
|
118
127
|
}
|
119
128
|
}
|
120
129
|
|
121
|
-
File.write(@export_path, export
|
130
|
+
File.write(@export_path, JSON.pretty_generate(export))
|
122
131
|
end
|
123
132
|
|
124
133
|
end
|
data/lib/ADNCV/display.rb
CHANGED
@@ -32,7 +32,7 @@ module ADNCV
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def exported(filename)
|
35
|
-
@thor.say_status :done, "Data exported in #{filename}", :green
|
35
|
+
@thor.say_status :done, "Data exported in #{filename}\n", :green
|
36
36
|
end
|
37
37
|
|
38
38
|
def clear_screen
|
@@ -50,13 +50,19 @@ module ADNCV
|
|
50
50
|
puts "Containing links:".ljust(50) + "#{data.with_links}" + "\n\n"
|
51
51
|
puts "Times your posts have been reposted:".ljust(50) + "#{data.reposts}" + "\n\n"
|
52
52
|
puts "Times your posts have been starred:".ljust(50) + "#{data.stars}" + "\n\n"
|
53
|
+
puts "Times your posts have been replied:".ljust(50) + "#{data.been_replied}" + "\n\n"
|
53
54
|
puts "Users you've posted directly to:".ljust(50) + "#{data.directed_users.size}" + "\n\n"
|
54
55
|
puts "Users you've mentioned:".ljust(50) + "#{data.names.size}" + "\n\n"
|
55
56
|
puts "You've posted with #{data.clients.size} clients:\n\n#{data.sources.reverse.join(', ')}" + "\n\n"
|
56
57
|
if options["full"]
|
57
|
-
puts "Your posted links:
|
58
|
+
puts "Your posted links: #{data.all_links.join(', ')}" + "\n\n"
|
58
59
|
puts "Users you've posted directly to: #{data.directed_users.reverse.join(', ')}" + "\n\n"
|
59
60
|
puts "Users you've mentioned: #{data.names.reverse.join(', ')}" + "\n\n"
|
61
|
+
puts "Your monthly posting frequency:\n\n"
|
62
|
+
@thor.print_table([["Year", "Month", "Posts\n"]])
|
63
|
+
puts "------------------"
|
64
|
+
@thor.print_table(data.freq)
|
65
|
+
puts "\n"
|
60
66
|
end
|
61
67
|
end
|
62
68
|
|
data/lib/ADNCV/version.rb
CHANGED
data/lib/ADNCV.rb
CHANGED