Permalink
Browse files

Added installation instructions and readme.

  • Loading branch information...
1 parent c6d69a6 commit 6c095d962e184ba62c1da2eed364140413f34267 @alexksikes committed Jun 30, 2009
Showing with 54 additions and 4 deletions.
  1. +43 −0 INSTALL
  2. +3 −0 README
  3. +3 −2 app/lib.py
  4. +5 −2 config.py → config_example.py
View
@@ -0,0 +1,43 @@
+1) Download the latest tar ball: http://github.com/alexksikes/wikitrivia/tarball/master.
+
+2) tar xvzf "the tar ball"
+
+3) Download install webpy, follow instructions here: http://webpy.org/install
+
+4) Setup lighttpd, here is a part your config file:
+
+ ...
+
+ name = "mailer"
+ script = "path to ./application.py"
+
+ server.document-root = "path to ./public/"
+
+ url.rewrite += (
+ # Commented for development
+ "^/img/(.*)$" => "/img/$1",
+ "^/css/(.*)$" => "/css/$1",
+ "^/js/(.*)$" => "/js/$1",
+
+ "^/(.*)$" => script + "/$1",
+ )
+
+ fastcgi.server += ( script =>
+ ((
+ "socket" => "/tmp/" + name + var.PID + ".socket",
+ "bin-path" => script,
+ "check-local" => "disable",
+ "max-procs" => 1,
+ "bin-environment" => (
+ "REAL_SCRIPT_NAME" => ""
+ ),
+ ))
+ )
+
+ ...
+
+5) Setup your database: mysql -p wikitrivia < ./schema.sql
+
+6) Go over your site settings: go over config_example.py and rename it config.py
+
+7) Restart lighttpd and you're done!
View
@@ -0,0 +1,3 @@
+Take quizes randomly generated using Wikipedia.
+
+http://www.wikitrivia.net
View
@@ -1,12 +1,13 @@
# Author: Alex Ksikes
+import config
+
import re, urllib, pycurl, cStringIO, string, random
from lxml import etree
def yahoo_search(query, start, results):
- appid = 'your app id'
url = 'http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=%s&query=%s&results=%s&start=%s' % \
- (appid, urllib.quote(query), results, start)
+ (config.yahoo_appid, urllib.quote(query), results, start)
xml = parse_xml(dnl(url))
results = []
@@ -1,7 +1,7 @@
import web, os
# connect to database
-db = web.database(dbn='mysql', db='wikitrivia', user='', passwd='')
+db = web.database(dbn='mysql', db='wikitrivia', user='user', passwd='password')
# in development debug error messages and reloader
web.config.debug = True
@@ -13,4 +13,7 @@
view = web.template.render('app/views', cache=cache)
# used to encrypt the answer
-encryption_key = 'mi$ey'
+encryption_key = 'a random string'
+
+# your yahoo app id
+yahoo_appid = ''

0 comments on commit 6c095d9

Please sign in to comment.