[Logilogi-svn] SF.net SVN: logilogi:[1610] trunk
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2009-10-04 18:39:48
|
Revision: 1610
http://logilogi.svn.sourceforge.net/logilogi/?rev=1610&view=rev
Author: wybow
Date: 2009-10-04 18:39:41 +0000 (Sun, 04 Oct 2009)
Log Message:
-----------
Adding new LogLog files
Modified Paths:
--------------
trunk/lib/tasks/daemons.rake
Added Paths:
-----------
trunk/app/models/log_log_subscription.rb
trunk/app/views/notifier/log.erb
Added: trunk/app/models/log_log_subscription.rb
===================================================================
--- trunk/app/models/log_log_subscription.rb (rev 0)
+++ trunk/app/models/log_log_subscription.rb 2009-10-04 18:39:41 UTC (rev 1610)
@@ -0,0 +1,34 @@
+#--#
+# Copyright: (c) 2006-2009 The LogiLogi Foundation <fou...@lo...>
+#
+# License:
+# This file is part of the LogiLogi program. LogiLogi is Free Software.
+# You can run/distribute/modify LogiLogi under the terms of the GNU Affero
+# General Public License version 3. The Affero GPL states that running a
+# modified version or a derivative work also requires you to make the source
+# code of that work available to everyone that can interact with it. We
+# chose the Affero GPL to ensure that LogiLogi remains open and libre
+# (doc/LICENSE contains the full text of the legally binding license).
+#++#
+
+class LogLogSubscription # < ActiveResource::Base
+# if GlobalConfig.done_with_basics? and GlobalConfig.use_log_log
+# self.site = GlobalConfig.log_log_site
+# self.user = GlobalConfig.log_log_api_key
+# self.element_name = "message"
+# end
+
+ def self.send_out_weekly_alerts
+ User.find_each do |user|
+ url = URI.parse(GlobalConfig.log_log_site + "/channels/for_" + user.unix_name + "/periods/weekly.txt")
+ begin
+ page = Net::HTTP.get_response(url)
+ periodical = page.body
+ if periodical =~ /[^\s]/
+ Notifier.deliver_log(user, user.unix_name, periodical)
+ end
+ rescue
+ end
+ end
+ end
+end
Added: trunk/app/views/notifier/log.erb
===================================================================
--- trunk/app/views/notifier/log.erb (rev 0)
+++ trunk/app/views/notifier/log.erb 2009-10-04 18:39:41 UTC (rev 1610)
@@ -0,0 +1,3 @@
+Update for channel <%= @channel %> on <%= GlobalConfig.domain %>.
+
+<%= @periodical %>
Modified: trunk/lib/tasks/daemons.rake
===================================================================
--- trunk/lib/tasks/daemons.rake 2009-10-04 17:43:39 UTC (rev 1609)
+++ trunk/lib/tasks/daemons.rake 2009-10-04 18:39:41 UTC (rev 1610)
@@ -55,7 +55,9 @@
ActiveRecord::Base.logger.add(Logger::INFO, "Weekly started at #{Time.now}.\n")
- LogLogSubscription.send_out_weekly_alerts
+ if GlobalConfig.use_log_log
+ LogLogSubscription.send_out_weekly_alerts
+ end
ActiveRecord::Base.logger.add(Logger::INFO, "Weekly finished at #{Time.now}.\n")
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|