typo 4.1 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/TODO-4.2 +14 -0
- data/TODO.MULTIUSERS +45 -0
- data/app/controllers/admin/base_controller.rb +18 -0
- data/app/controllers/admin/general_controller.rb +14 -0
- data/app/controllers/application.rb +2 -1
- data/app/controllers/articles_controller.rb +18 -21
- data/app/helpers/admin/base_helper.rb +4 -4
- data/app/helpers/admin/feedback_helper.rb +3 -3
- data/app/helpers/application_helper.rb +2 -6
- data/app/helpers/sidebar_helper.rb +2 -2
- data/app/models/blog.rb +9 -1
- data/app/models/category.rb +9 -9
- data/app/models/comment.rb +1 -1
- data/app/models/content_state/presumed_ham.rb +2 -2
- data/app/models/resource.rb +2 -0
- data/app/views/admin/categories/_categories.rhtml +10 -6
- data/app/views/admin/categories/edit.rhtml +3 -1
- data/app/views/admin/comments/_form.rhtml +3 -3
- data/app/views/admin/comments/list.rhtml +7 -5
- data/app/views/admin/comments/new.rhtml +3 -1
- data/app/views/admin/comments/show.rhtml +3 -1
- data/app/views/admin/content/_articles.rhtml +1 -1
- data/app/views/admin/content/_form.rhtml +4 -2
- data/app/views/admin/content/new.rhtml +1 -0
- data/app/views/admin/content/preview.rhtml +8 -8
- data/app/views/admin/feedback/_item.rhtml +3 -1
- data/app/views/admin/feedback/list.rhtml +4 -4
- data/app/views/admin/general/index.rhtml +14 -1
- data/app/views/admin/pages/_form.rhtml +1 -1
- data/app/views/admin/pages/destroy.rhtml +1 -1
- data/app/views/admin/pages/new.rhtml +1 -0
- data/app/views/admin/shared/_edit.rhtml +2 -2
- data/app/views/layouts/administration.rhtml +5 -2
- data/app/views/layouts/minimal.rhtml +134 -2
- data/config/boot.rb +1 -1
- data/config/environment.rb +11 -3
- data/config/environments/test.rb +0 -7
- data/config/routes.rb +3 -0
- data/db/migrate/004_add_sidebars.rb +21 -3
- data/db/migrate/056_create_notifications.rb +1 -1
- data/db/migrate/062_add_sitealizer_plugin.rb +18 -0
- data/db/schema.mysql-v3.sql +217 -0
- data/db/schema.mysql.sql +31 -5
- data/db/schema.postgresql.sql +31 -6
- data/db/schema.rb +17 -7
- data/db/schema.sqlite.sql +31 -6
- data/db/schema.sqlserver.sql +32 -6
- data/db/schema_version +1 -1
- data/lang/de_DE.rb +493 -0
- data/lang/fr_FR.rb +28 -4
- data/lang/ro_RO.rb +554 -0
- data/lib/tasks/release.rake +7 -7
- data/lib/typo_version.rb +1 -1
- data/public/images/sitealizer/bar.gif +0 -0
- data/public/images/sitealizer/uv.png +0 -0
- data/public/images/sitealizer/vh.png +0 -0
- data/public/javascripts/tiny_mce/blank.htm +9 -0
- data/public/javascripts/tiny_mce/langs/en.js +41 -0
- data/public/javascripts/tiny_mce/license.txt +504 -0
- data/public/javascripts/tiny_mce/themes/advanced/about.htm +52 -0
- data/public/javascripts/tiny_mce/themes/advanced/anchor.htm +33 -0
- data/public/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
- data/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +13 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_content.css +58 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_popup.css +331 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_ui.css +97 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/about.htm +31 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/common_buttons.htm +162 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm +45 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/index.htm +27 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm +32 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_image_button.htm +65 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_link_button.htm +33 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_table_button.htm +71 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/style.css +28 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1534 -0
- data/public/javascripts/tiny_mce/themes/advanced/image.htm +100 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/anchor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/anchor_symbol.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/backcolor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_de_se.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_fr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/browse.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bullist.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/button_menu.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/buttons.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cancel_button_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/charmap.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cleanup.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/close.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/code.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/color.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/copy.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/custom_1.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cut.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/forecolor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/help.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/hr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/image.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/indent.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/insert_button_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_de_se.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifycenter.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyfull.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyleft.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyright.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/link.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/menu_check.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/newdocument.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/numlist.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/opacity.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/outdent.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/paste.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/redo.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/removeformat.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/separator.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/spacer.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/statusbar_resize.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/strikethrough.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/sub.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/sup.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_fr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/undo.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/unlink.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/visualaid.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_end.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tabs_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/about.js +75 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/anchor.js +74 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/charmap.js +326 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/color_picker.js +108 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/image.js +81 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/link.js +70 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/source_editor.js +60 -0
- data/public/javascripts/tiny_mce/themes/advanced/langs/en.js +82 -0
- data/public/javascripts/tiny_mce/themes/advanced/link.htm +100 -0
- data/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +32 -0
- data/public/javascripts/tiny_mce/tiny_mce.js +1 -0
- data/public/javascripts/tiny_mce/tiny_mce_popup.js +288 -0
- data/public/javascripts/tiny_mce/tiny_mce_src.js +7284 -0
- data/public/javascripts/tiny_mce/utils/editable_selects.js +61 -0
- data/public/javascripts/tiny_mce/utils/form_utils.js +210 -0
- data/public/javascripts/tiny_mce/utils/mclayer.js +210 -0
- data/public/javascripts/tiny_mce/utils/mctabs.js +74 -0
- data/public/javascripts/tiny_mce/utils/validate.js +219 -0
- data/public/stylesheets/administration.css +5 -1
- data/public/stylesheets/minimal.css +1 -0
- data/test/functional/admin/categories_controller_test.rb +2 -2
- data/test/functional/xml_controller_test.rb +72 -40
- data/test/test_helper.rb +1 -17
- data/test/unit/article_test.rb +1 -1
- data/test/unit/trigger_test.rb +1 -1
- data/themes/scribbish/views/articles/_comment.rhtml +13 -17
- data/themes/scribbish/views/articles/_comment_form.rhtml +7 -5
- data/themes/scribbish/views/articles/_comment_list.rhtml +7 -0
- data/themes/scribbish/views/articles/read.rhtml +1 -1
- data/vendor/plugins/aimpresence_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/archives_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/audioscrobbler_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/audioscrobbler_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/audioscrobbler_sidebar/README +27 -0
- data/vendor/plugins/backpack_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/backpack_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/backpack_sidebar/README +27 -0
- data/vendor/plugins/category_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/sitealizer/CHANGELOG +6 -0
- data/vendor/plugins/sitealizer/LICENSE +22 -0
- data/vendor/plugins/sitealizer/README +82 -0
- data/vendor/plugins/sitealizer/Rakefile +22 -0
- data/vendor/plugins/sitealizer/init.rb +24 -0
- data/vendor/plugins/sitealizer/install.rb +22 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/bar.gif +0 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/uv.png +0 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/vh.png +0 -0
- data/vendor/plugins/sitealizer/lib/app/controllers/sitealizer_controller.rb +118 -0
- data/vendor/plugins/sitealizer/lib/app/models/site_tracker.rb +145 -0
- data/vendor/plugins/sitealizer/lib/app/views/layouts/sitealizer.rhtml +66 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_browsers.rhtml +23 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_daily_stats.rhtml +67 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_hits_summary.rhtml +0 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_hosts.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_keywords.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_languages.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_main_frame.rhtml +84 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml +67 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_page_urls.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_platforms.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_referers.rhtml +22 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_robots.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_search_engines.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/hourly_stats.rhtml +39 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/index.rhtml +8 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/login.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/menu.rhtml +74 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/referrer_stats.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/search_stats.rhtml +25 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/summary.rhtml +22 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/visitor_info.rhtml +30 -0
- data/vendor/plugins/sitealizer/lib/config.yml +18 -0
- data/vendor/plugins/sitealizer/lib/sitealizer/parser.rb +347 -0
- data/vendor/plugins/sitealizer/lib/sitealizer.rb +78 -0
- data/vendor/plugins/sitealizer/lib/tasks/sitealizer.rake +36 -0
- data/vendor/plugins/sitealizer/test/fixtures/sitealizer.yml +89 -0
- data/vendor/plugins/sitealizer/test/sitealizer_controller_test.rb +208 -0
- data/vendor/plugins/sitealizer/test/sitealizer_parser_test.rb +169 -0
- data/vendor/plugins/sitealizer/test/test_helper.rb +7 -0
- data/vendor/plugins/tada_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/tada_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/tada_sidebar/README +27 -0
- data/vendor/plugins/tag_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/tiny_mce/README +10 -0
- data/vendor/plugins/tiny_mce/Rakefile +22 -0
- data/vendor/plugins/tiny_mce/TODO +2 -0
- data/vendor/plugins/tiny_mce/changelog +1017 -0
- data/vendor/plugins/tiny_mce/init.rb +3 -0
- data/vendor/plugins/tiny_mce/install.rb +1 -0
- data/vendor/plugins/tiny_mce/lib/tiny_mce.rb +36 -0
- data/vendor/plugins/tiny_mce/lib/tiny_mce_helper.rb +48 -0
- data/vendor/plugins/tiny_mce/tasks/tiny_mce.rake +40 -0
- data/vendor/plugins/tiny_mce/test/helper_testcase.rb +38 -0
- data/vendor/plugins/tiny_mce/test/tiny_mce_helper_test.rb +67 -0
- data/vendor/plugins/tiny_mce/test/tiny_mce_test.rb +85 -0
- data/vendor/plugins/tiny_mce/tiny_mce_options.yml +121 -0
- data/vendor/plugins/xbox_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/xbox_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/xbox_sidebar/README +27 -0
- data/vendor/plugins/xml_sidebar/lib/xml_sidebar.rb +1 -1
- data/vendor/plugins/xml_sidebar/views/content.rhtml +4 -4
- metadata +220 -4
- data/TODO-4.1 +0 -16
@@ -0,0 +1,26 @@
|
|
1
|
+
This is a list of Typo maintainers. If you have a commit bit, please add your
|
2
|
+
name and contact details to the list.
|
3
|
+
|
4
|
+
Original Author
|
5
|
+
|
6
|
+
Tobias Luetke <tobi@leetsoft.com>
|
7
|
+
blog: http://blog.leetsoft.com/
|
8
|
+
irc: xal
|
9
|
+
|
10
|
+
Peons
|
11
|
+
|
12
|
+
Scott Laird <scott@sigkill.org>
|
13
|
+
blog: http://scottstuff.net/
|
14
|
+
irc: slaird
|
15
|
+
|
16
|
+
Piers Cawley <pdcawley@bofh.org.uk>
|
17
|
+
blog: http://www.bofh.org.uk/
|
18
|
+
irc: pdcawley
|
19
|
+
|
20
|
+
Kevin Ballard <kevin@sb.org>
|
21
|
+
blog: http://kevin.sb.org
|
22
|
+
irc: Eridius
|
23
|
+
|
24
|
+
Frédéric de Villamil <frederic@de-villamil.com>
|
25
|
+
blog: http://fredericdevillamil.com
|
26
|
+
irc: neuro`
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2005 Tobias Luetke
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
What is it?
|
2
|
+
===========
|
3
|
+
|
4
|
+
This is an audioscrobbler sidebar plugin for typo blogging engine.
|
5
|
+
|
6
|
+
Requirements
|
7
|
+
============
|
8
|
+
|
9
|
+
Currently you need all of those things to get typo to run:
|
10
|
+
|
11
|
+
* Typo 1.4.1 or higer
|
12
|
+
* Rails 1.2.x
|
13
|
+
|
14
|
+
Installation
|
15
|
+
============
|
16
|
+
|
17
|
+
When in Typo root directory, just run
|
18
|
+
./script/plugin install http://svn.typosphere.org/typo/plugins/audioscrobbler_sidebar/
|
19
|
+
|
20
|
+
Usage
|
21
|
+
======
|
22
|
+
|
23
|
+
Typo's administrative interface is available at http://your.domain.com/admin.
|
24
|
+
To activate the plugin, drag and drop it in the sidebar and fill the config.
|
25
|
+
|
26
|
+
Enjoy,
|
27
|
+
Your typo team
|
@@ -0,0 +1,26 @@
|
|
1
|
+
This is a list of Typo maintainers. If you have a commit bit, please add your
|
2
|
+
name and contact details to the list.
|
3
|
+
|
4
|
+
Original Author
|
5
|
+
|
6
|
+
Tobias Luetke <tobi@leetsoft.com>
|
7
|
+
blog: http://blog.leetsoft.com/
|
8
|
+
irc: xal
|
9
|
+
|
10
|
+
Peons
|
11
|
+
|
12
|
+
Scott Laird <scott@sigkill.org>
|
13
|
+
blog: http://scottstuff.net/
|
14
|
+
irc: slaird
|
15
|
+
|
16
|
+
Piers Cawley <pdcawley@bofh.org.uk>
|
17
|
+
blog: http://www.bofh.org.uk/
|
18
|
+
irc: pdcawley
|
19
|
+
|
20
|
+
Kevin Ballard <kevin@sb.org>
|
21
|
+
blog: http://kevin.sb.org
|
22
|
+
irc: Eridius
|
23
|
+
|
24
|
+
Frédéric de Villamil <frederic@de-villamil.com>
|
25
|
+
blog: http://fredericdevillamil.com
|
26
|
+
irc: neuro`
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2005 Tobias Luetke
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
What is it?
|
2
|
+
===========
|
3
|
+
|
4
|
+
This is an audioscrobbler sidebar plugin for typo blogging engine.
|
5
|
+
|
6
|
+
Requirements
|
7
|
+
============
|
8
|
+
|
9
|
+
Currently you need all of those things to get typo to run:
|
10
|
+
|
11
|
+
* Typo 1.4.1 or higer
|
12
|
+
* Rails 1.2.x
|
13
|
+
|
14
|
+
Installation
|
15
|
+
============
|
16
|
+
|
17
|
+
When in Typo root directory, just run
|
18
|
+
./script/plugin install http://svn.typosphere.org/typo/plugins/audioscrobbler_sidebar/
|
19
|
+
|
20
|
+
Usage
|
21
|
+
======
|
22
|
+
|
23
|
+
Typo's administrative interface is available at http://your.domain.com/admin.
|
24
|
+
To activate the plugin, drag and drop it in the sidebar and fill the config.
|
25
|
+
|
26
|
+
Enjoy,
|
27
|
+
Your typo team
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2007 Thiago Jackiw
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
The "Created with Sitealizer" footer text should not be removed from the
|
14
|
+
locations where it's currently shown (under the '/sitealizer' controller)
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
@@ -0,0 +1,82 @@
|
|
1
|
+
= Sitealizer Web Stats plugin for Rails
|
2
|
+
This plugin lets you track visitors, referrers, robots, search terms and more. And it shouldn’t influence your site’s performance because it only saves the basic visitor information (after every 10(default) visits) in a threaded process and all the data processing is done when viewing the stats.
|
3
|
+
|
4
|
+
== Author
|
5
|
+
Thiago Jackiw:: tjackiw at gmail dot com
|
6
|
+
|
7
|
+
== Current Release
|
8
|
+
The current stable release is v1.1 released on 03-20-2007.
|
9
|
+
|
10
|
+
== License Info
|
11
|
+
Please refer to the LICENSE[link:files/LICENSE.html]
|
12
|
+
|
13
|
+
== Installation
|
14
|
+
On your Rails' root directory, just type
|
15
|
+
|
16
|
+
script/plugin install http://opensvn.csie.org/sitealizer
|
17
|
+
|
18
|
+
and add the following line to your config/routes.rb:
|
19
|
+
|
20
|
+
map.connect '/sitealizer/:action', :controller => 'sitealizer'
|
21
|
+
|
22
|
+
== Upgrading from SiteMeter
|
23
|
+
If you had previously installed 'sitemeter' you need to run the following command after installing Sitealizer, otherwise your stats <b>will not be imported</b>:
|
24
|
+
|
25
|
+
rake sitealizer:remove_sitemeter
|
26
|
+
|
27
|
+
You also need to change:
|
28
|
+
|
29
|
+
* include SiteMeter TO Include Sitealizer
|
30
|
+
* before_filter :use_site_meter TO before_filter :use_sitealizer
|
31
|
+
* map.connect '/sitemeter/:action', :controller => 'sitemeter' TO map.connect '/sitealizer/:action', :controller => 'sitealizer'
|
32
|
+
|
33
|
+
== Configuration
|
34
|
+
There are four configuration options that can be changed under sitealizer/lib/config.yml:
|
35
|
+
<em>access_type</em>:: Accepts <em>private</em> or <em>public</em> as the value. <em>Private</em>: you have to enter the username and password below in order to view the stats. <em>Public</em>: Anyone can view your site's stats
|
36
|
+
<em>username</em>:: This username will be used to log in to your Sitealizer
|
37
|
+
<em>password</em>:: This password will be used to log in to your Sitealizer
|
38
|
+
<em>queue_size</em>:: The number of visitors in the queue before saving the stats to the DB. Default is 10. Minimum size shouldn't be under 5
|
39
|
+
|
40
|
+
== Usage
|
41
|
+
To track the visitors on your entire application, just edit your ApplicationController(application.rb):
|
42
|
+
|
43
|
+
class ApplicationController < ActionController::Base
|
44
|
+
include Sitealizer
|
45
|
+
before_filter :use_sitealizer
|
46
|
+
end
|
47
|
+
|
48
|
+
Or to track specific controllers:
|
49
|
+
|
50
|
+
class ApplicationController < ActionController::Base
|
51
|
+
include Sitealizer
|
52
|
+
end
|
53
|
+
|
54
|
+
class MyController < ApplicationController
|
55
|
+
before_filter :use_sitealizer
|
56
|
+
end
|
57
|
+
|
58
|
+
== Viewing the stats
|
59
|
+
To view your stats just add "/sitealizer" to your main url:
|
60
|
+
|
61
|
+
http://www.example.com/sitealizer
|
62
|
+
|
63
|
+
== Using Sitealizer?
|
64
|
+
I’d like to include your site on the list below. Please send me an email (tjackiw at gmail dot com) with your site’s url.
|
65
|
+
* www.californiabusinesslist.com
|
66
|
+
* www.nottr.com
|
67
|
+
* www.bacotp.com
|
68
|
+
|
69
|
+
== Getting help
|
70
|
+
You can always send me an email (tjackiw at gmail dot com) if you have any questions.
|
71
|
+
|
72
|
+
== Bugs/Patches
|
73
|
+
Please report the bugs you find by opening tickets here[https://opensvn.csie.org/traccgi/sitealizer/newticket]
|
74
|
+
|
75
|
+
== Special Thanks to:
|
76
|
+
* RubyForge (www.rubyforge.org)
|
77
|
+
|
78
|
+
== Other plugins by the Author:
|
79
|
+
* acts_as_solr (http://acts-as-solr.rubyforge.org)
|
80
|
+
|
81
|
+
== Release Information
|
82
|
+
Released under the MIT license.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
desc 'Default: run unit tests.'
|
6
|
+
task :default => :test
|
7
|
+
|
8
|
+
desc 'Test the sitealizer plugin.'
|
9
|
+
Rake::TestTask.new(:test) do |t|
|
10
|
+
t.libs << 'lib'
|
11
|
+
t.pattern = 'test/**/*_test.rb'
|
12
|
+
t.verbose = true
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'Generate documentation for the sitealizer plugin.'
|
16
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
17
|
+
rdoc.rdoc_dir = 'rdoc'
|
18
|
+
rdoc.title = 'Sitealizer'
|
19
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
20
|
+
rdoc.rdoc_files.include('README')
|
21
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright (c) 2007 Thiago Jackiw
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in all
|
11
|
+
# copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# The "Created with Sitealizer" footer text should not be removed from the
|
14
|
+
# locations where it's currently shown (under the '/sitealizer' controller)
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
|
24
|
+
require 'sitealizer'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'ftools'
|
2
|
+
|
3
|
+
dest_dir = File.dirname(__FILE__)+'/../../../public/images/sitealizer'
|
4
|
+
File.makedirs(dest_dir) unless File.exists?(dest_dir)
|
5
|
+
|
6
|
+
Dir[File.dirname(__FILE__)+'/lib/app/assets/images/*'].each do |src|
|
7
|
+
File.copy(src, dest_dir+'/')
|
8
|
+
end
|
9
|
+
|
10
|
+
puts "
|
11
|
+
Sitealizer v.1.1 installed
|
12
|
+
|
13
|
+
Don't forget to add the following line to your config/routes.rb:
|
14
|
+
map.connect '/sitealizer/:action', :controller => 'sitealizer'
|
15
|
+
|
16
|
+
== IMPORTANT ==
|
17
|
+
If you had previously installed 'sitemeter' you need to run the following if you want to import your stats:
|
18
|
+
rake sitealizer:remove_sitemeter
|
19
|
+
|
20
|
+
Please visit http://sitealizer.rubyforge.org if you have any questions
|
21
|
+
|
22
|
+
"
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,118 @@
|
|
1
|
+
require 'digest/sha1'
|
2
|
+
SA_CONFIG = YAML::load_file(File.dirname(__FILE__)+'/../../config.yml')
|
3
|
+
|
4
|
+
class SitealizerController < ActionController::Base
|
5
|
+
|
6
|
+
before_filter :check_access_type, :except => [:login, :logout]
|
7
|
+
layout 'sitealizer'
|
8
|
+
|
9
|
+
def self.template_root
|
10
|
+
"#{RAILS_ROOT}/vendor/plugins/sitealizer/lib/app/views"
|
11
|
+
end
|
12
|
+
|
13
|
+
def login
|
14
|
+
return unless request.post?
|
15
|
+
if params[:username] == SA_CONFIG['sitealizer']['username'].to_s && params[:password] == SA_CONFIG['sitealizer']['password'].to_s
|
16
|
+
cookies[:sitealizer] = {:value => Digest::SHA1.hexdigest("--#{Time.now.to_i}--#{params[:username]}--")}
|
17
|
+
redirect_to :action => 'index'
|
18
|
+
else
|
19
|
+
flash[:notice] = "Username/Password Invalid"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def logout
|
24
|
+
cookies.delete :sitealizer
|
25
|
+
redirect_to :action => 'login'
|
26
|
+
end
|
27
|
+
|
28
|
+
def index
|
29
|
+
if !params[:month] && !params[:year]
|
30
|
+
params[:month] = sprintf("%02d",Time.now.month)
|
31
|
+
params[:year] = Time.now.year
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def menu
|
36
|
+
months = []
|
37
|
+
years = []
|
38
|
+
f = SiteTracker.find(:all, :limit => 1, :order => 'created_on ASC')
|
39
|
+
l = SiteTracker.find(:all, :limit => 1, :order => 'created_on DESC')
|
40
|
+
first = !f.empty? ? f.first.created_on : Date.today
|
41
|
+
last = !l.empty? ? l.first.created_on : Date.today
|
42
|
+
(first.to_date..last.to_date).each{|d| months << d.month unless months.include?(d.month)}
|
43
|
+
(first.to_date..last.to_date).each{|d| years << d.year unless years.include?(d.year)}
|
44
|
+
@months = months.sort.map{|m|
|
45
|
+
m=sprintf('%02d',m);
|
46
|
+
"<option #{"selected" if m.to_i == params[:month].to_i } value=#{m}>#{m}</option>"
|
47
|
+
}
|
48
|
+
@years = years.sort.map{|y|
|
49
|
+
"<option #{"selected" if y == params[:year].to_i} value=#{y}>#{y}</option>"
|
50
|
+
}
|
51
|
+
@cookie = cookies[:sitealizer]
|
52
|
+
end
|
53
|
+
|
54
|
+
def summary
|
55
|
+
@year = nil
|
56
|
+
@month = nil
|
57
|
+
begin
|
58
|
+
if "#{params[:year]}-#{params[:month]}-1".to_time
|
59
|
+
@year = params[:year]
|
60
|
+
@month = params[:month]
|
61
|
+
end
|
62
|
+
rescue
|
63
|
+
@year = Time.now.year
|
64
|
+
@month = sprintf("%02d",Time.now.month)
|
65
|
+
end
|
66
|
+
@total_hits = SiteTracker.count_hits(:year => @year, :month => @month)
|
67
|
+
@unique_hits = SiteTracker.count_hits(:count => 'DISTINCT ip', :year => @year, :month => @month)
|
68
|
+
@daily_hits = SiteTracker.find_daily_hits(:year => @year, :month => @month)
|
69
|
+
@month_hits = SiteTracker.find_monthly_hits(:year => @year)
|
70
|
+
@year_hits = SiteTracker.count_hits(:date => "#{@year}-%")
|
71
|
+
@year_uniq = SiteTracker.count_hits(:date => "#{@year}-%", :count => "DISTINCT ip")
|
72
|
+
file = File.dirname(__FILE__)+'/../../last_update'
|
73
|
+
@last_update = File.exists?(file) ? open(file,'r'){|f| f.read.to_time.to_s(:long)} : "Not updated yet"
|
74
|
+
end
|
75
|
+
|
76
|
+
def hourly_stats
|
77
|
+
@year = params[:year] || Time.now.year
|
78
|
+
@month = params[:month] || sprintf("%02d",Time.now.month)
|
79
|
+
@total_hits = SiteTracker.count_hits(:year => @year, :month => @month)
|
80
|
+
@hourly_hits = SiteTracker.find_hourly_hits(:year => @year, :month => @month)
|
81
|
+
end
|
82
|
+
|
83
|
+
def search_stats
|
84
|
+
@year = params[:year] || Time.now.year
|
85
|
+
@month = params[:month] || sprintf("%02d",Time.now.month)
|
86
|
+
@keywords = SiteTracker.find_search_terms(:year => @year, :month => @month)
|
87
|
+
@engines = SiteTracker.find_domains(:year => @year, :month => @month, :host => request.host)
|
88
|
+
@robots = SiteTracker.find_robots(:year => @year, :month => @month)
|
89
|
+
end
|
90
|
+
|
91
|
+
def visitor_info
|
92
|
+
@year = params[:year] || Time.now.year
|
93
|
+
@month = params[:month] || sprintf("%02d",Time.now.month)
|
94
|
+
@total_hits = SiteTracker.count_hits(:year => @year, :month => @month)
|
95
|
+
@browsers = SiteTracker.find_browsers(:year => @year, :month => @month)
|
96
|
+
@platforms = SiteTracker.find_platforms(:year => @year, :month => @month)
|
97
|
+
@hosts = SiteTracker.find_hosts(:year => @year, :month => @month)
|
98
|
+
@languages = SiteTracker.find_languages(:year => @year, :month => @month)
|
99
|
+
end
|
100
|
+
|
101
|
+
def referrer_stats
|
102
|
+
@year = params[:year] || Time.now.year
|
103
|
+
@month = params[:month] || sprintf("%02d",Time.now.month)
|
104
|
+
@total_hits = SiteTracker.count_hits(:year => @year, :month => @month)
|
105
|
+
@referers = SiteTracker.find_referers(:year => @year, :month => @month)
|
106
|
+
@page_urls = SiteTracker.find_page_urls(:year => @year, :month => @month)
|
107
|
+
end
|
108
|
+
|
109
|
+
protected
|
110
|
+
def check_access_type
|
111
|
+
if SA_CONFIG['sitealizer']['access_type'] == 'private'
|
112
|
+
unless cookies[:is_admin]
|
113
|
+
redirect_to :controller => 'accounts', :action => 'login'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
class SiteTracker < ActiveRecord::Base
|
2
|
+
set_table_name 'sitealizer'
|
3
|
+
|
4
|
+
def self.find_browsers(params={})
|
5
|
+
browsers = {}
|
6
|
+
tmp = []
|
7
|
+
r = find_by_sql("SELECT user_agent, COUNT(*) AS total FROM sitealizer WHERE created_on "+
|
8
|
+
"LIKE '#{params[:year]}-#{params[:month]}%' GROUP BY user_agent ORDER BY total DESC")
|
9
|
+
r.each{|env|
|
10
|
+
browser_info = Sitealizer::Parser::UserAgent.browser_info(env.user_agent)
|
11
|
+
tmp << {:total => env.total, :browser => browser_info[:type], :version => browser_info[:version]}
|
12
|
+
}
|
13
|
+
tmp.each{|set| n = "#{set[:browser]}|#{set[:version]}"; browsers[n] = (browsers[n]||0) + set[:total].to_i}
|
14
|
+
browsers = browsers.inject([]){|a,v|
|
15
|
+
name = v[0].split("|")
|
16
|
+
a << {:browser => {:type => name[0], :version => name[1]}, :total => v[1]}
|
17
|
+
}
|
18
|
+
return browsers.sort{|x,y| y[:total] <=> x[:total]}
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.find_platforms(params={})
|
22
|
+
platforms = {}
|
23
|
+
tmp = []
|
24
|
+
r = find_by_sql("SELECT user_agent, COUNT(*) AS total FROM sitealizer WHERE created_on "+
|
25
|
+
"LIKE '#{params[:year]}-#{params[:month]}%' GROUP BY user_agent ORDER BY total DESC")
|
26
|
+
r.each{|env|
|
27
|
+
tmp << {:total => env.total, :name => Sitealizer::Parser::UserAgent.get_platform(env.user_agent)}
|
28
|
+
}
|
29
|
+
tmp.each{|set| platforms[set[:name]] = (platforms[set[:name]]||0) + set[:total].to_i}
|
30
|
+
platforms = platforms.inject([]){|a,v| a << {:name => v[0], :total => v[1]}}
|
31
|
+
return platforms.sort{|x,y| y[:total] <=> x[:total]}
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.find_robots(params={})
|
35
|
+
robots = {}
|
36
|
+
tmp = []
|
37
|
+
r = find_by_sql("SELECT user_agent, COUNT(*) AS total FROM sitealizer WHERE created_on "+
|
38
|
+
"LIKE '#{params[:year]}-#{params[:month]}%' GROUP BY user_agent ORDER BY total DESC")
|
39
|
+
r.each{|env|
|
40
|
+
bot = Sitealizer::Parser::Robot.get_name(env.user_agent)
|
41
|
+
tmp << {:total => env.total, :name => bot} if bot
|
42
|
+
}
|
43
|
+
tmp.each{|set| robots[set[:name]] = (robots[set[:name]]||0) + set[:total].to_i}
|
44
|
+
robots = robots.inject([]){|a,v| a << {:name => v[0], :total => v[1]}}
|
45
|
+
return robots.sort{|x,y| y[:total] <=> x[:total]}
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.find_search_terms(params={})
|
49
|
+
terms = {}
|
50
|
+
tmp = []
|
51
|
+
r = find_by_sql("SELECT referer, COUNT(*) AS total FROM sitealizer WHERE created_on "+
|
52
|
+
"LIKE '#{params[:year]}-#{params[:month]}%' GROUP BY referer ORDER BY total DESC LIMIT 30")
|
53
|
+
r.each{|env|
|
54
|
+
term = Sitealizer::Parser::Keyword.get_terms(env.referer)
|
55
|
+
tmp << {:total => env.total, :query => term} if term
|
56
|
+
}
|
57
|
+
tmp.each{|set| terms[set[:query]] = (terms[set[:query]]||0) + set[:total].to_i}
|
58
|
+
terms = terms.inject([]){|a,v| a << {:query => v[0], :total => v[1]}}
|
59
|
+
return terms.sort{|x,y| y[:total] <=> x[:total]}
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.find_domains(params={})
|
63
|
+
domains = {}
|
64
|
+
tmp = []
|
65
|
+
r = find_by_sql("SELECT referer, COUNT(*) AS total FROM sitealizer WHERE created_on "+
|
66
|
+
"LIKE '#{params[:year]}-#{params[:month]}%' GROUP BY referer ORDER BY total DESC LIMIT 30")
|
67
|
+
r.each{|env|
|
68
|
+
domain = Sitealizer::Parser::Keyword.get_domain(env.referer, params[:host])
|
69
|
+
tmp << {:total => env.total, :domain => domain} if domain
|
70
|
+
}
|
71
|
+
tmp.each{|set| domains[set[:domain]] = (domains[set[:domain]]||0) + set[:total].to_i}
|
72
|
+
domains = domains.inject([]){|a,v| a << {:domain => v[0], :total => v[1]}}
|
73
|
+
return domains.sort{|x,y| y[:total] <=> x[:total]}
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.find_referers(params={})
|
77
|
+
find_by_sql("SELECT referer, COUNT(*) AS total " +
|
78
|
+
"FROM sitealizer WHERE created_on LIKE '#{params[:year]}-#{params[:month]}%' "+
|
79
|
+
"GROUP BY referer ORDER BY total DESC LIMIT 30")
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.find_page_urls(params={})
|
83
|
+
find_by_sql("SELECT path, COUNT(*) AS total " +
|
84
|
+
"FROM sitealizer WHERE created_on LIKE '#{params[:year]}-#{params[:month]}%' "+
|
85
|
+
"GROUP BY path ORDER BY total DESC LIMIT 30")
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.find_hosts(params={})
|
89
|
+
find_by_sql("SELECT ip, COUNT(*) AS total FROM sitealizer WHERE "+
|
90
|
+
"created_on LIKE '#{params[:year]}-#{params[:month]}%' "+
|
91
|
+
"GROUP BY ip ORDER BY total DESC LIMIT 30")
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.find_languages(params={})
|
95
|
+
find_by_sql("SELECT language, COUNT(*) AS total FROM sitealizer WHERE "+
|
96
|
+
"created_on LIKE '#{params[:year]}-#{params[:month]}%' "+
|
97
|
+
"GROUP BY language ORDER BY total DESC LIMIT 15")
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.count_hits(params={})
|
101
|
+
count = !params[:count] ? "*" : params[:count]
|
102
|
+
date = !params[:date] ? "#{params[:year]}-#{params[:month]}%" : params[:date]
|
103
|
+
count_by_sql("SELECT COUNT(#{count}) FROM sitealizer WHERE created_on LIKE '#{date}'")
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.find_monthly_hits(params={})
|
107
|
+
dataset = []
|
108
|
+
12.times{|month| month+=1
|
109
|
+
created = "#{params[:year]}-#{sprintf("%02d",month)}-%"
|
110
|
+
date = "#{params[:year]}-#{month}-1".to_time.strftime('%B %Y')
|
111
|
+
date_short = "#{params[:year]}-#{month}-1".to_time.strftime('%b %Y')
|
112
|
+
visits = count_by_sql("SELECT COUNT(DISTINCT ip) FROM sitealizer WHERE created_on LIKE '#{created}'")
|
113
|
+
hits = count_by_sql("SELECT COUNT(*) FROM sitealizer WHERE created_on LIKE '#{created}'")
|
114
|
+
dataset << [date_short, visits, hits, date]
|
115
|
+
}
|
116
|
+
dataset
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.find_daily_hits(params={})
|
120
|
+
dataset = []
|
121
|
+
days_in_mon = Date.civil(params[:year].to_i, params[:month].to_i, -1).day
|
122
|
+
days_in_mon.times{|day| day+=1
|
123
|
+
created = "#{params[:year]}-#{params[:month]}-#{sprintf("%02d",day)}"
|
124
|
+
date = "#{params[:year]}-#{params[:month]}-#{day}".to_time.strftime('%b %d %Y')
|
125
|
+
visits = count_by_sql("SELECT COUNT(DISTINCT ip) FROM sitealizer WHERE created_on = '#{created}'")
|
126
|
+
hits = count_by_sql("SELECT COUNT(*) FROM sitealizer WHERE created_on = '#{created}'")
|
127
|
+
dataset << [day, visits, hits, date]
|
128
|
+
}
|
129
|
+
dataset
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.find_hourly_hits(params={})
|
133
|
+
dataset = []
|
134
|
+
24.times{|hour|
|
135
|
+
hour = sprintf("%02d",hour)
|
136
|
+
visits = count_by_sql("SELECT COUNT(DISTINCT ip) FROM sitealizer "+
|
137
|
+
"WHERE created_at LIKE '#{params[:year]}-#{params[:month]}% #{hour}:%'")
|
138
|
+
hits = count_by_sql("SELECT COUNT(*) FROM sitealizer WHERE "+
|
139
|
+
"created_at LIKE '#{params[:year]}-#{params[:month]}% #{hour}:%'")
|
140
|
+
dataset << [hour.to_s, visits, hits]
|
141
|
+
}
|
142
|
+
dataset
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|