Index: trunk/tools/editor_trends/js_scripts/first_ten_edits.js |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +/* |
| 3 | +Copyright (C) 2010 by Diederik van Liere (dvanliere@gmail.com) |
| 4 | +This program is free software; you can redistribute it and/or |
| 5 | +modify it under the terms of the GNU General Public License version 2 |
| 6 | +as published by the Free Software Foundation. |
| 7 | +This program is distributed in the hope that it will be useful, |
| 8 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | +See the GNU General Public License for more details, at |
| 11 | +http://www.fsf.org/licenses/gpl.html |
| 12 | +*/ |
| 13 | + |
| 14 | +/* |
| 15 | +PURPOSE: Retrieve first 10 edits from an editor |
| 16 | +INPUT: Collection name, array of ids |
| 17 | +OUTPUT: List of dates by editor |
| 18 | +*/ |
| 19 | + |
| 20 | + |
| 21 | +editors = db['editors']; |
| 22 | +for (i=0; i < 1000000; i++) { |
| 23 | + { |
| 24 | + authors = db.editors.find({"editor": i.toString()}).sort({"date":1}).limit(10); |
| 25 | + |
| 26 | + try |
| 27 | + { |
| 28 | + for (a=0; a < authors.length(); a++) |
| 29 | + { |
| 30 | + print(i.toString(), authors[a]["date"]); |
| 31 | + } |
| 32 | + } |
| 33 | + catch(err) |
| 34 | + { |
| 35 | + print(err); |
| 36 | + } |
| 37 | + } |
| 38 | + } |
Property changes on: trunk/tools/editor_trends/js_scripts/first_ten_edits.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 39 | + native |
Index: trunk/tools/editor_trends/js_scripts/last_edit.js |
— | — | @@ -0,0 +1,34 @@ |
| 2 | +/* |
| 3 | +Copyright (C) 2010 by Diederik van Liere (dvanliere@gmail.com) |
| 4 | +This program is free software; you can redistribute it and/or |
| 5 | +modify it under the terms of the GNU General Public License version 2 |
| 6 | +as published by the Free Software Foundation. |
| 7 | +This program is distributed in the hope that it will be useful, |
| 8 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | +See the GNU General Public License for more details, at |
| 11 | +http://www.fsf.org/licenses/gpl.html |
| 12 | +*/ |
| 13 | + |
| 14 | +/* |
| 15 | +PURPOSE: Retrieve last edit from an editor |
| 16 | +INPUT: Collection name, array of ids |
| 17 | +OUTPUT: Last date of edit by id |
| 18 | +*/ |
| 19 | + |
| 20 | +editors = db['editors']; |
| 21 | +for (i=7861; i < 717535; i++) { |
| 22 | + try |
| 23 | + { |
| 24 | + authors = db.editors.find({"editor": i.toString()}, {"date":1}).sort({"date":-1}).limit(1); |
| 25 | + |
| 26 | + for (a=0; a < authors.length(); a++) |
| 27 | + { |
| 28 | + print(i.toString(), authors[a]["date"]) |
| 29 | + } |
| 30 | + } |
| 31 | + catch(err) |
| 32 | + { |
| 33 | + print(err); |
| 34 | + } |
| 35 | + } |
\ No newline at end of file |
Property changes on: trunk/tools/editor_trends/js_scripts/last_edit.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 36 | + native |
Index: trunk/tools/editor_trends/js_scripts/new_wikipedians.bat |
— | — | @@ -0,0 +1,4 @@ |
| 2 | +@echo off |
| 3 | +cd \mongodb\bin |
| 4 | +mongo 127.0.0.1/editors last_edit.js > last_edit.csv |
| 5 | +mongo 127.0.0.1/editors retrieve_editor_ids.js > ids.csv |
\ No newline at end of file |
Property changes on: trunk/tools/editor_trends/js_scripts/new_wikipedians.bat |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 6 | + native |
Index: trunk/tools/editor_trends/js_scripts/retrieve_editor_ids.js |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +/* |
| 3 | +Copyright (C) 2010 by Diederik van Liere (dvanliere@gmail.com) |
| 4 | +This program is free software; you can redistribute it and/or |
| 5 | +modify it under the terms of the GNU General Public License version 2 |
| 6 | +as published by the Free Software Foundation. |
| 7 | +This program is distributed in the hope that it will be useful, |
| 8 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | +See the GNU General Public License for more details, at |
| 11 | +http://www.fsf.org/licenses/gpl.html |
| 12 | +*/ |
| 13 | + |
| 14 | +/* |
| 15 | +PURPOSE: Retrieve all editor ids. |
| 16 | +INPUT: Collection name |
| 17 | +OUTPUT: Array of editor ids |
| 18 | + |
| 19 | +FUTURE USE: array can be used in subsequent queries. |
| 20 | +*/ |
| 21 | + |
| 22 | +editors = db['editors']; |
| 23 | +c = db.editors.distinct('editor'); |
| 24 | +print(c); |
\ No newline at end of file |
Property changes on: trunk/tools/editor_trends/js_scripts/retrieve_editor_ids.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 25 | + native |
Property changes on: trunk/tools/editor_trends/js_scripts |
___________________________________________________________________ |
Added: svn:ignore |
2 | 26 | + wikistats |
zips |
notes.txt |
*.pyc |
*.xml |
*.db |
*.bin |
*.zip |
*.csv |
datasets |
errors |
.settings |
.project |
.pydevproject |
wiki.cfg |
fabric.py |
fabfile.py |
deployment |
data |