Permalink
Browse files

refactoring

  • Loading branch information...
1 parent d808a69 commit bee0125b643bb7ff26f197b42d8efe0d0ab341a3 @niklasb committed May 26, 2012
View
@@ -5,6 +5,6 @@ channels:
- '#kitinfo'
date_format: '%d.%m.%Y'
time_format: '%d.%m.%Y %H:%M'
-stats_url: http://dtun.de:4567/?channel=%s
+stats_url: http://bot.kitinfo.de/stats/?channel=%s
source_url: https://github.com/niklasb
database: sqlite://db/kitbot.sqlite3
View
@@ -7,7 +7,7 @@
require 'sequel'
require 'uri'
-$: << File.expand_path('..', __FILE__)
+$: << File.expand_path('../lib', __LE__)
require 'feedwatch'
require 'ircbot'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -29,6 +29,10 @@ def start_of_year
end
get '/' do
+ haml :index
+end
+
+get '/stats' do
msgs = stats.filter(channel: params[:channel] || $config['channels'].first)
@stats = [Date.today, start_of_week, start_of_month, nil].map { |start|
@@ -41,5 +45,5 @@ def start_of_year
result.having('total > 0').order(:total).reverse.all
}
}
- haml :index
+ haml :stats
end
@@ -0,0 +1,8 @@
+!!!
+%html
+ %head
+ %title #kitinfo
+ %link(rel="stylesheet" href="css/styles.css")
+ %body
+ %p
+ %a(href="stats") Stats
File renamed without changes.

0 comments on commit bee0125

Please sign in to comment.