StatsCollect 0.2.0.20110830 → 0.3.0.20120314
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +3 -1
- data/ChangeLog +15 -0
- data/LICENSE +1 -1
- data/README +2 -5
- data/ReleaseInfo +8 -8
- data/bin/StatsCollect.rb +3 -3
- data/lib/StatsCollect/Backends/MySQL.rb +63 -63
- data/lib/StatsCollect/Backends/Terminal.rb +43 -43
- data/lib/StatsCollect/Locations/AddThis.rb +7 -7
- data/lib/StatsCollect/Locations/CSV.rb +9 -9
- data/lib/StatsCollect/Locations/Facebook.rb +7 -7
- data/lib/StatsCollect/Locations/FacebookArtist.rb +7 -7
- data/lib/StatsCollect/Locations/FacebookLike.rb +7 -7
- data/lib/StatsCollect/Locations/GoogleGroup.rb +10 -10
- data/lib/StatsCollect/Locations/GoogleSearch.rb +6 -6
- data/lib/StatsCollect/Locations/MySpace.rb +43 -43
- data/lib/StatsCollect/Locations/RB.rb +10 -10
- data/lib/StatsCollect/Locations/ReverbNation.rb +34 -34
- data/lib/StatsCollect/Locations/Tweets.rb +7 -7
- data/lib/StatsCollect/Locations/Twitter.rb +11 -11
- data/lib/StatsCollect/Locations/Youtube.rb +33 -49
- data/lib/StatsCollect/Notifiers/Custom.rb +3 -3
- data/lib/StatsCollect/Notifiers/LogFile.rb +4 -4
- data/lib/StatsCollect/Notifiers/None.rb +3 -3
- data/lib/StatsCollect/Notifiers/SendMail.rb +3 -3
- data/lib/StatsCollect/Stats.rb +81 -81
- data/lib/StatsCollect/StatsOrdersProxy.rb +3 -3
- data/lib/StatsCollect/StatsProxy.rb +28 -28
- metadata +24 -12
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2010 -
|
2
|
+
# Copyright (c) 2010 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
3
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
4
|
#++
|
5
5
|
|
@@ -20,14 +20,14 @@ module StatsCollect
|
|
20
20
|
|
21
21
|
# Add a new stats order
|
22
22
|
#
|
23
|
-
# Parameters
|
23
|
+
# Parameters::
|
24
24
|
# * *iID* (_Integer_): An ID identifying uniquely this stats order. It will be used to tell which stats orders have to be dequeued later.
|
25
25
|
# * *iTimeStamp* (_DateTime_): Time stamp
|
26
26
|
# * *iLstLocations* (<em>list<String></em>): List of locations
|
27
27
|
# * *iLstObjects* (<em>list<String></em>): List of objects
|
28
28
|
# * *iLstCategories* (<em>list<String></em>): List of categories
|
29
29
|
# * *iStatus* (_Integer_): Status
|
30
|
-
def
|
30
|
+
def add_stats_order(iID, iTimeStamp, iLstLocations, iLstObjects, iLstCategories, iStatus)
|
31
31
|
lLstSortedLocations = iLstLocations.sort.uniq
|
32
32
|
lLstSortedObjects = iLstObjects.sort.uniq
|
33
33
|
lLstSortedCategories = iLstCategories.sort.uniq
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2010 -
|
2
|
+
# Copyright (c) 2010 - 2012 Muriel Salvan (muriel@x-aeon.com)
|
3
3
|
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
4
|
#++
|
5
5
|
|
@@ -22,7 +22,7 @@ module StatsCollect
|
|
22
22
|
|
23
23
|
# Constructor
|
24
24
|
#
|
25
|
-
# Parameters
|
25
|
+
# Parameters::
|
26
26
|
# * *iLstObjects* (<em>list<String></em>): List of objects to filter (can be empty for all)
|
27
27
|
# * *iLstCategories* (<em>list<String></em>): List of categories to filter (can be empty for all)
|
28
28
|
# * *iBackend* (_Object_): The backend
|
@@ -36,11 +36,11 @@ module StatsCollect
|
|
36
36
|
|
37
37
|
# Check if a specific object is included in the filter
|
38
38
|
#
|
39
|
-
# Parameters
|
39
|
+
# Parameters::
|
40
40
|
# * *iObjectName* (_String_): The object to check
|
41
|
-
# Return
|
41
|
+
# Return::
|
42
42
|
# * _Boolean_: Is the object included in the filter ?
|
43
|
-
def
|
43
|
+
def is_object_included?(iObjectName)
|
44
44
|
rIncluded = false
|
45
45
|
|
46
46
|
if (@LstObjects.empty?)
|
@@ -54,11 +54,11 @@ module StatsCollect
|
|
54
54
|
|
55
55
|
# Check if a specific category is included in the filter
|
56
56
|
#
|
57
|
-
# Parameters
|
57
|
+
# Parameters::
|
58
58
|
# * *iCategoryName* (_String_): The category to check
|
59
|
-
# Return
|
59
|
+
# Return::
|
60
60
|
# * _Boolean_: Is the category included in the filter ?
|
61
|
-
def
|
61
|
+
def is_category_included?(iCategoryName)
|
62
62
|
rIncluded = false
|
63
63
|
|
64
64
|
if (@LstCategories.empty?)
|
@@ -72,14 +72,14 @@ module StatsCollect
|
|
72
72
|
|
73
73
|
# Add a new stat
|
74
74
|
#
|
75
|
-
# Parameters
|
75
|
+
# Parameters::
|
76
76
|
# * *iObject* (_String_): The object
|
77
77
|
# * *iCategory* (_String_): The category
|
78
78
|
# * *iValue* (_Object_): The value
|
79
79
|
# * *iOptions* (<em>map<Symbol,Object></em>): Additional options [optional = {}]:
|
80
|
-
#
|
81
|
-
#
|
82
|
-
def
|
80
|
+
# * *:Timestamp* (_DateTime_): Time stamp of this stat [optional = DateTime.now]
|
81
|
+
# * *:Location* (_String_): Location of this stat [optional = <PluginName>]
|
82
|
+
def add_stat(iObject, iCategory, iValue, iOptions = {})
|
83
83
|
lTimestamp = (iOptions[:Timestamp] || DateTime.now)
|
84
84
|
lLocation = (iOptions[:Location] || @Location)
|
85
85
|
@StatsToAdd << [
|
@@ -94,52 +94,52 @@ module StatsCollect
|
|
94
94
|
|
95
95
|
# Add a stats list
|
96
96
|
#
|
97
|
-
# Parameters
|
98
|
-
# * *iLstStats* (<em>list<[...]></em>): List of stats. See :StatsToAdd property for internal fields to set.
|
99
|
-
def
|
97
|
+
# Parameters::
|
98
|
+
# * *iLstStats* (<em>list< [...] ></em>): List of stats. See :StatsToAdd property for internal fields to set.
|
99
|
+
def add_stats_list(iLstStats)
|
100
100
|
@StatsToAdd.concat(iLstStats)
|
101
101
|
end
|
102
102
|
|
103
103
|
# Add a new recoverable order
|
104
104
|
#
|
105
|
-
# Parameters
|
105
|
+
# Parameters::
|
106
106
|
# * *iLstObjects* (<em>list<String></em>): The failing objects
|
107
107
|
# * *iLstCategories* (<em>list<String></em>): The failing categories
|
108
|
-
def
|
108
|
+
def add_recoverable_order(iLstObjects, iLstCategories)
|
109
109
|
@RecoverableOrders << [ iLstObjects, iLstCategories ]
|
110
110
|
end
|
111
111
|
|
112
112
|
# Add a new unrecoverable order
|
113
113
|
#
|
114
|
-
# Parameters
|
114
|
+
# Parameters::
|
115
115
|
# * *iLstObjects* (<em>list<String></em>): The failing objects
|
116
116
|
# * *iLstCategories* (<em>list<String></em>): The failing categories
|
117
|
-
def
|
117
|
+
def add_unrecoverable_order(iLstObjects, iLstCategories)
|
118
118
|
@UnrecoverableOrders << [ iLstObjects, iLstCategories ]
|
119
119
|
end
|
120
120
|
|
121
121
|
# Get the list of categories
|
122
122
|
#
|
123
|
-
# Return
|
123
|
+
# Return::
|
124
124
|
# * <em>map<String,[Integer,Integer]></em>: The list of categories and their associated ID and value type
|
125
|
-
def
|
126
|
-
return @Backend.
|
125
|
+
def get_categories
|
126
|
+
return @Backend.get_known_categories
|
127
127
|
end
|
128
128
|
|
129
129
|
# Get the list of objects
|
130
130
|
#
|
131
|
-
# Return
|
131
|
+
# Return::
|
132
132
|
# * <em>map<String,Integer></em>: The list of objects and their associated ID
|
133
|
-
def
|
134
|
-
return @Backend.
|
133
|
+
def get_objects
|
134
|
+
return @Backend.get_known_objects
|
135
135
|
end
|
136
136
|
|
137
137
|
# Get the list of locations
|
138
138
|
#
|
139
|
-
# Return
|
139
|
+
# Return::
|
140
140
|
# * <em>map<String,Integer></em>: The list of locations and their associated ID
|
141
|
-
def
|
142
|
-
return @Backend.
|
141
|
+
def get_locations
|
142
|
+
return @Backend.get_known_locations
|
143
143
|
end
|
144
144
|
|
145
145
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: StatsCollect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
7
|
+
- 3
|
9
8
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.
|
9
|
+
- 20120314
|
10
|
+
version: 0.3.0.20120314
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Muriel Salvan
|
@@ -16,11 +15,25 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date:
|
20
|
-
|
21
|
-
|
18
|
+
date: 2012-03-14 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rUtilAnts
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: "1.0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
22
35
|
description: StatsCollect is a little framework gathering statistics from external sources (social networks, web sites...), stored in pluggable backends. It can be very easily extended thanks to its plugins (currently include Facebook, Myspace, Youtube, Google).
|
23
|
-
email:
|
36
|
+
email: muriel@x-aeon.com
|
24
37
|
executables:
|
25
38
|
- StatsCollect.rb
|
26
39
|
extensions: []
|
@@ -58,6 +71,7 @@ files:
|
|
58
71
|
- README
|
59
72
|
- ReleaseInfo
|
60
73
|
- StatsCollect.conf.rb.example
|
74
|
+
has_rdoc: true
|
61
75
|
homepage: http://statscollect.sourceforge.net/
|
62
76
|
licenses: []
|
63
77
|
|
@@ -71,7 +85,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
85
|
requirements:
|
72
86
|
- - ">="
|
73
87
|
- !ruby/object:Gem::Version
|
74
|
-
hash: 3
|
75
88
|
segments:
|
76
89
|
- 0
|
77
90
|
version: "0"
|
@@ -80,14 +93,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
93
|
requirements:
|
81
94
|
- - ">="
|
82
95
|
- !ruby/object:Gem::Version
|
83
|
-
hash: 3
|
84
96
|
segments:
|
85
97
|
- 0
|
86
98
|
version: "0"
|
87
99
|
requirements: []
|
88
100
|
|
89
101
|
rubyforge_project: statscollect
|
90
|
-
rubygems_version: 1.
|
102
|
+
rubygems_version: 1.3.7
|
91
103
|
signing_key:
|
92
104
|
specification_version: 3
|
93
105
|
summary: Command line tool gathering statistics from external sources.
|