Index: trunk/extensions/WikiTrust/Makefile |
— | — | @@ -1,44 +0,0 @@ |
2 | | -# Copyright (c) 2007-2008 The Regents of the University of California |
3 | | -# All rights reserved. |
4 | | -# |
5 | | -# Authors: Luca de Alfaro, B. Thomas Adler, Ian Pye |
6 | | -# |
7 | | -# Redistribution and use in source and binary forms, with or without |
8 | | -# modification, are permitted provided that the following conditions are met: |
9 | | -# |
10 | | -# 1. Redistributions of source code must retain the above copyright notice, |
11 | | -# this list of conditions and the following disclaimer. |
12 | | -# |
13 | | -# 2. Redistributions in binary form must reproduce the above copyright notice, |
14 | | -# this list of conditions and the following disclaimer in the documentation |
15 | | -# and/or other materials provided with the distribution. |
16 | | -# |
17 | | -# 3. The names of the contributors may not be used to endorse or promote |
18 | | -# products derived from this software without specific prior written |
19 | | -# permission. |
20 | | -# |
21 | | -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
22 | | -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
23 | | -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
24 | | -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
25 | | -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
26 | | -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
27 | | -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
28 | | -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
29 | | -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
30 | | -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
31 | | -# POSSIBILITY OF SUCH DAMAGE. |
32 | | - |
33 | | -all: |
34 | | - cd analysis; make all |
35 | | - |
36 | | -allopt: |
37 | | - cd analysis; make allopt; cp eval_online_wiki .. ; cp vote_revision .. |
38 | | - |
39 | | -install: |
40 | | - cp eval_online_wiki vote_revision /usr/local/bin/ |
41 | | - |
42 | | -clean: |
43 | | - cd analysis; make clean |
44 | | - rm -f eval_online_wiki vote_revision |
45 | | - |
Index: trunk/extensions/WikiTrust/README |
— | — | @@ -1,254 +0,0 @@ |
2 | | -WikiTrust can be used to assign text trust and author reputation in |
3 | | -real-time, as edits to a wiki are made. Text trust is displayed via |
4 | | -different colors for the text background, from dark orange (low trust) |
5 | | -to white (maximum trust). The colors can be easily changed by |
6 | | -changing a skin file. |
7 | | - |
8 | | -The extension can be added to an existing wiki, or to a new one. |
9 | | -If the extension is added to a new wiki, it will start computing |
10 | | -reputations and trusts as soon as someone makes an edit, or requests |
11 | | -to view a trust-colored revision. The reputation and trust |
12 | | -computation takes some time, after which the coloring is available. |
13 | | -If you switch the extension off, then on, the extension will compute |
14 | | -the missing reputation and trust values in a self-healing, |
15 | | -fault-tolerant fashion. |
16 | | - |
17 | | - |
18 | | -PREREQUISITES: |
19 | | - |
20 | | -1) Install mysql and mediawiki. In Ubuntu / Debian, you can install |
21 | | - the packages: |
22 | | - |
23 | | - mediawiki |
24 | | - php5-cli |
25 | | - mysql-server |
26 | | - mysql-client |
27 | | - tidy |
28 | | - |
29 | | - In other distributions, follow the instructions at |
30 | | - www.mediawiki.org. |
31 | | - |
32 | | - |
33 | | -================================================================ |
34 | | - |
35 | | -THE FAST WAY: |
36 | | - |
37 | | -We provide a statically-linked executable, which is built under |
38 | | -Ubuntu, but should work under many versions of linux. |
39 | | -If you are happy using it, then you can use these abbreaviated |
40 | | -instructions. Otherwise, see at the bottom of this file for an |
41 | | -alternative to step 2) below, which involves compiling |
42 | | -eval_online_wiki from source. |
43 | | - |
44 | | -2) Take a deep breath. |
45 | | - |
46 | | -3) Next, you need to install the trust coloring extension in |
47 | | - mediawiki. There are two ways to do this: |
48 | | - |
49 | | - 3a) Leaving the files in place, and using symbolic links. This is |
50 | | - the preferred course of action: in this way, when we release bug |
51 | | - fixes via git, you can simply update your version of WikiTrust, |
52 | | - recompile the code if needed (most likely), and be done with it. |
53 | | - In alternative 3b) below, you would need to then copy the new |
54 | | - files to appropriate places. |
55 | | - |
56 | | - To build symbolic links in Ubuntu you can proceed as follows |
57 | | - (the process is similar for other distributions; only the |
58 | | - destination directory path may be different): |
59 | | - |
60 | | - $ cd /var/lib/mediawiki/extensions |
61 | | - $ sudo ln -s /home/username/wikitrust/mediawiki/extensions/Trust . |
62 | | - |
63 | | - 3b) Alternatively, use 'cp' statements rather than symbolic links: |
64 | | - |
65 | | - $ cd /var/lib/mediawiki/extensions |
66 | | - $ sudo cp -r /home/username/wikitrust/mediawiki/extensions/Trust . |
67 | | - |
68 | | -4) You should activate the extension by editing |
69 | | - LocalSettings.php (part of the MediaWiki installation), adding the |
70 | | - following lines: |
71 | | - |
72 | | -# Trust extension |
73 | | -$wgUseTidy = true; |
74 | | -$wgUseAjax = true; |
75 | | - // If true, create an index on revision(rev_id, rev_timestamp) |
76 | | -$wgCreateRevisionIndex = true; |
77 | | -$wgShowVoteButton = true; // If true, the vote button is shown. |
78 | | -$wgVoteText = "I believe this information is correct"; |
79 | | -$wgThankYouForVoting = "Thank you for your vote."; |
80 | | -$wgTrustCmd = "/home/username/wikitrust/eval_online_wiki"; |
81 | | -$wgTrustLog = "/somedir/{$wgDBname}-trust.log"; |
82 | | -$wgTrustDebugLog = "/somedir/{$wgDBname}-trust-debug.log"; |
83 | | -$wgRepSpeed = 1.0; |
84 | | -$wgTrustTabText = "check text"; |
85 | | -$wgTrustExplanation = '{| border="1" cellpadding="5" cellspacing="0" style="background:lightgreen; color:black" |
86 | | -|- |
87 | | -| The above text is colored according to how much it has been revised. An orange background indicates new, unrevised, text; white is for text that has been revised by many reputed authors. If you click on a word, you will be redirected to the diff corresponding to the edit where the word was introduced. If you hover over a word with the mouse pointer, a pop-up displays the name of the author of the word. |
88 | | -|- |
89 | | -| The text color and origin are computed by [http://trust.cse.ucsc.edu/WikiTrust WikiTrust]; if you notice problems, you can submit a bug report [http://code.google.com/p/wikitrust/issues here]. |
90 | | -|}'; |
91 | | -$wgNoTrustExplanation = '{| border="1" cellpadding="5" cellspacing="0" style="background:lightgreen; color:black" |
92 | | -|- |
93 | | -| There is no trust information available for this text yet. |
94 | | -|}'; |
95 | | - |
96 | | -require_once( $IP . "/extensions/Trust/TrustBase.php"); |
97 | | -require_once( $IP . "/extensions/Trust/Trust.php" ); |
98 | | - |
99 | | - Above, we are requesting that two logs be created: |
100 | | - |
101 | | - $wgTrustLog = "/somedir/{$wgDBname}-trust.log"; |
102 | | - |
103 | | - This creates a log of the analysis of how useful each contribution to |
104 | | - the wiki is, as well as a log of all user reputation changes. |
105 | | - We advise you to create such a log: it contains very useful |
106 | | - information, and it is likely that we will develop a variety of tools |
107 | | - to extract the information present. You don't want to miss out. Note |
108 | | - that you are responsible for rotating / compressing the log (e.g., via |
109 | | - logrotate, or /etc/logrotate.conf or /etc/logrotate.d/ |
110 | | - |
111 | | - On the other hand, the log requested via |
112 | | - |
113 | | - $wgTrustDebugLog = "/somedir/{$wgDBname}-trust-debug.log"; |
114 | | - |
115 | | - is just useful to us to track down bugs and other problems, and can be |
116 | | - safely disabled. You can disable these logs via: |
117 | | - |
118 | | - $wgTrustLog = "/dev/null"; |
119 | | - $wgTrustDebugLog = "/dev/null"; |
120 | | - |
121 | | -5) You need to make the installation readable from the web server. |
122 | | - |
123 | | - 5a) If you used method 3a), you can do: |
124 | | - |
125 | | - $ chmod -R a+rX /home/username/wikitrust |
126 | | - |
127 | | - 5b) If you used method 3b), you can do: |
128 | | - |
129 | | - $ cd /var/lib/mediawiki/extensions |
130 | | - $ sudo chown -R www-data:www-data Trust |
131 | | - $ cp /home/user/wikitrust/eval_online_wiki /usr/local/bin/ |
132 | | - $ sudo chmod a+rx /usr/local/bin/eval_online_wiki |
133 | | - |
134 | | -6) You need to create the database tables that the trust coloring |
135 | | - extension will use. Assuming that the mediawiki database is called |
136 | | - "wikidb" (this is the default name: you give a name to the database |
137 | | - when you create the wiki instance during the MediaWiki installation |
138 | | - process), proceed as follows: |
139 | | - |
140 | | - $ cd sql |
141 | | - $ ./create_db.php "path_to_mediawiki" "mysql_root_user_name" |
142 | | - |
143 | | - where path_to_mediawiki is the path to the mediawiki installation |
144 | | - (such as /usr/share/mediawiki). |
145 | | - If you need to remove the tables, before recreating them, the |
146 | | - command is: |
147 | | - |
148 | | - $ ./create_db.php "path_to_mediawiki" "mysql_root_user_name" remove |
149 | | - |
150 | | -7) If there are already revisions in the wiki, you should first |
151 | | - analyze their trust, via: |
152 | | - |
153 | | - $ ./eval_online_wiki -n_revs 1000000 -db_user <username> -db_pass <pwd> -db_name <db_name> |
154 | | - |
155 | | - The '1000000' means that eval_online_wiki will compute the trust of |
156 | | - at most 1000000 revisions, then stop. You can repeat the above |
157 | | - command as many times as needed (or with a larger or smaller bound) |
158 | | - until all revisions are analyzed for trust; each invocation will |
159 | | - analyze at most 1000000 additional revisions. Typical values for |
160 | | - these parameters are: |
161 | | - |
162 | | - username: wikiuser |
163 | | - db_name: wikidb |
164 | | - |
165 | | - If you wish to redo the analysis from scratch, throwing away the |
166 | | - results of previous analyses, you can use the option '-delete_all': |
167 | | - |
168 | | - $ ./eval_online_wiki -delete_all -n_revs 1000000 -db_user <username> -db_pass <pwd> -db_name <db_name> |
169 | | - |
170 | | - Warning: the analysis can take a long time on very large wikis, so |
171 | | - do not use the option '-delete_all' lightly! |
172 | | - |
173 | | -8) You should now see a trust tab. Click on it, or edit a revision, and |
174 | | - the trust of all revision text, and the reputation of all authors, |
175 | | - will be computed. |
176 | | - |
177 | | - The trust coloring is updated automatically whenever a user edits |
178 | | - an article, or requests to view the trust informaton for a |
179 | | - revision. In particular, when a user edits an article, or when |
180 | | - someone asks to view the trust information, WikiTrust computes the |
181 | | - trust coloring not only for the newest revision, but for all past |
182 | | - revisions of all wiki articles that have not been colored yet. |
183 | | - |
184 | | -9) If you wish to upload pages to the wiki from a dump file, go to the |
185 | | - test-scripts directory, and follow the instructions in the README |
186 | | - file there. |
187 | | - |
188 | | -================================================================ |
189 | | - |
190 | | -COMPILING FROM SOURCE |
191 | | - |
192 | | -If you like, you can also build the packages from source. |
193 | | -Follow these instructions in place of step 2) above. |
194 | | - |
195 | | -2a) You need to install some packages for Ocaml. There are two ways. |
196 | | - |
197 | | - 2a1) The best way is to use godi (http://godi.camlcity.org), as this |
198 | | - enables you to build everything in userspace. |
199 | | - |
200 | | - Get godi from http://godi.camlcity.org/godi/index.html and |
201 | | - download godi. Follow the instructions to install it. Install |
202 | | - the following Ocaml packages from godi: |
203 | | - |
204 | | - godi-extlib |
205 | | - godi-findlib |
206 | | - godi-ocaml-mysql |
207 | | - godi-sexplib |
208 | | - godi-type-conv |
209 | | - |
210 | | - 2a2) If you do not wish to use godi, you can get the above packages |
211 | | - either from their source, or from the linux distribution you |
212 | | - are using. For Ubuntu, you can use the following packages: |
213 | | - |
214 | | - ocaml (version 3.10.0 or greater) |
215 | | - ocaml-base |
216 | | - ocaml-native-compilers |
217 | | - ocaml-findlib |
218 | | - libmysql-ocaml |
219 | | - libmysql-ocaml-dev |
220 | | - libextlib-ocaml-dev |
221 | | - python-mysqldb |
222 | | - libxml-light-ocaml-dev |
223 | | - libzip-ocaml-dev |
224 | | - |
225 | | - You also need: |
226 | | - |
227 | | - type-conv |
228 | | - sexplib |
229 | | - |
230 | | - Which are available from |
231 | | - http://www.janestcapital.com/ocaml/index.html . |
232 | | - |
233 | | -2b) Make OcamlLdaLibs and install them. |
234 | | - If you can install without sudo rights: |
235 | | - $ make all |
236 | | - If you did not use godi, so that you need sudo rights to install: |
237 | | - $ make all-sudo |
238 | | - |
239 | | -2c) Compile the code: |
240 | | - |
241 | | - $ make clean ; make all ; make allopt |
242 | | - |
243 | | - This creates an eval_online_wiki executable, which is what |
244 | | - computes text trust and origin, and author reputation, in a wiki. |
245 | | - The executable is called whenever someone edit the wiki, or wishes |
246 | | - to see a trust-colored version of a page. |
247 | | - |
248 | | -================================================================ |
249 | | - |
250 | | -BATCH MODE: |
251 | | - |
252 | | -The tool has also a batch mode, useful for computing statistical |
253 | | -quantities of a wiki. Please see batch/README for more information. |