skynet-core 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/skynet-core/db/ibrands.rb +53 -4
- data/skynet-core.gemspec +2 -2
- metadata +4 -4
data/Rakefile
CHANGED
@@ -34,11 +34,11 @@ unless Skynet.database_config.nil?
|
|
34
34
|
AND networks.classification = ?", "passive", (args.first || nil)],
|
35
35
|
:order => "tracked_networks.updated_at ASC", :limit => 30, :include => :network}}
|
36
36
|
|
37
|
-
|
37
|
+
named_scope :especific_brand, lambda {|*args| { :conditions => ["brand_id = ? AND tracked_networks.state = ?
|
38
38
|
AND networks.classification = ?", (args[0] || nil), "passive", (args[1] || nil)],
|
39
39
|
:order => "tracked_networks.updated_at ASC", :limit => 30, :include => :network}}
|
40
40
|
|
41
|
-
|
41
|
+
named_scope :especific_track, lambda {|*args| { :conditions => ["brand_id is not null AND id = ?
|
42
42
|
AND networks.classification = ?", (args[0] || nil), (args[1] || nil)],
|
43
43
|
:order => "tracked_networks.updated_at ASC", :limit => 30, :include => :network}}
|
44
44
|
|
@@ -111,8 +111,33 @@ unless Skynet.database_config.nil?
|
|
111
111
|
class FamiliarUrl < ActiveRecord::Base
|
112
112
|
validates_presence_of :url
|
113
113
|
|
114
|
-
named_scope :rss_sources, :select => "distinct url", :conditions => ["url_type in (3,4)"]
|
114
|
+
named_scope :rss_sources, :select => "distinct url", :conditions => ["url_type in (3,4) AND state = 'passive'"], :limit => 30
|
115
115
|
named_scope :url_sources, :conditions => ["url_type not in (3,4)"]
|
116
|
+
|
117
|
+
|
118
|
+
def processing!
|
119
|
+
self.state = 'in_processing' if self.state == 'passive'
|
120
|
+
self.save
|
121
|
+
end
|
122
|
+
|
123
|
+
def processing?
|
124
|
+
self.state == 'in_processing'
|
125
|
+
end
|
126
|
+
|
127
|
+
def mining_is_ok!
|
128
|
+
self.state = 'passive' if self.state == 'in_processing'
|
129
|
+
self.save
|
130
|
+
end
|
131
|
+
|
132
|
+
def passive?
|
133
|
+
self.state == 'passive'
|
134
|
+
end
|
135
|
+
|
136
|
+
def mining_is_not_ok!
|
137
|
+
self.state = 'registred' if self.state == 'in_processing'
|
138
|
+
self.save
|
139
|
+
end
|
140
|
+
|
116
141
|
end
|
117
142
|
|
118
143
|
|
@@ -121,7 +146,31 @@ unless Skynet.database_config.nil?
|
|
121
146
|
|
122
147
|
named_scope :by_brand, lambda {|*args| { :conditions => ["brand_id = ?", (args[0] || nil)]}}
|
123
148
|
named_scope :metagenerator, :conditions => ["url_type = 2"]
|
124
|
-
named_scope :rss_sources, :select => "distinct url", :conditions => ["url_type in (3,4)"]
|
149
|
+
named_scope :rss_sources, :select => "distinct url", :conditions => ["url_type in (3,4) AND state = 'passive'"], :limit => 30
|
150
|
+
|
151
|
+
|
152
|
+
def processing!
|
153
|
+
self.state = 'in_processing' if self.state == 'passive'
|
154
|
+
self.save
|
155
|
+
end
|
156
|
+
|
157
|
+
def processing?
|
158
|
+
self.state == 'in_processing'
|
159
|
+
end
|
160
|
+
|
161
|
+
def mining_is_ok!
|
162
|
+
self.state = 'passive' if self.state == 'in_processing'
|
163
|
+
self.save
|
164
|
+
end
|
165
|
+
|
166
|
+
def passive?
|
167
|
+
self.state == 'passive'
|
168
|
+
end
|
169
|
+
|
170
|
+
def mining_is_not_ok!
|
171
|
+
self.state = 'registred' if self.state == 'in_processing'
|
172
|
+
self.save
|
173
|
+
end
|
125
174
|
|
126
175
|
def self.by_brand(brand, url_type = nil)
|
127
176
|
if url_type.blank?
|
data/skynet-core.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{skynet-core}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Henry Hamon"]
|
9
|
-
s.date = %q{2010-06-
|
9
|
+
s.date = %q{2010-06-16}
|
10
10
|
s.description = %q{Datamining Bot}
|
11
11
|
s.email = %q{henry.hamon@a2c.com.br}
|
12
12
|
s.extra_rdoc_files = ["README.mkdn", "lib/skynet-core.rb", "lib/skynet-core/cyberdyne.rb", "lib/skynet-core/db/hippocampus.rb", "lib/skynet-core/db/ibrands.rb", "lib/skynet-core/db/migrate/001_create_actives_and_logs.rb", "lib/skynet-core/db/migrate/002_pimp_log.rb", "lib/skynet-core/db/migration.rb", "lib/skynet-core/extend_string.rb", "lib/skynet-core/harvest.rb"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skynet-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henry Hamon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-16 00:00:00 -03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|