-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4daddb4
commit a55f8b9
Showing
12 changed files
with
125 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,31 @@ | ||
wikifunken | ||
========== | ||
|
||
Tools to bring Wikipedia Offline | ||
Tools to bring Wikipedia Offline | ||
|
||
|
||
|
||
|
||
|
||
# Select NUM=1000 articles to donload and select | ||
~/dev/wikifunken/ ./articleselector.py scored_articles.15.11.12.txt 1000 > data/articles.txt | ||
selected 1000 of 1139809 articles with minimum rank 1846 | ||
|
||
# Fetch articles | ||
~/dev/wikifunken/ ./fetcharticles.py data/articles.txt data/articles/ | ||
|
||
# fetch images | ||
~/dev/wikifunken/ ./getimagelinks.py data/articles/ | sort | uniq > data/images.txt | ||
|
||
|
||
|
||
|
||
# define layout | ||
|
||
# Process Articles | ||
# rewrites links, removes unwanted sections, ... | ||
|
||
# index articles | ||
# | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env python | ||
''' | ||
pip install whoosh | ||
''' | ||
import sys, os | ||
import urllib2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
__author__ = 'heiko' | ||
import os | ||
import flask | ||
app = flask.Flask(__name__) | ||
pwd = os.path.dirname(__file__) | ||
articles_dir = os.path.join(pwd, 'articles') | ||
|
||
|
||
@app.route('/') | ||
def index(): | ||
return 'Hello Homepage' | ||
|
||
|
||
@app.route('/search/') | ||
def search(): | ||
query = flask.request.form['query'] | ||
return 'Searched for %s' % query | ||
|
||
@app.route('/wiki/<path:name>') | ||
def page(name): | ||
try: | ||
assert not '..' in name | ||
return open(os.path.join(articles_dir, name)).read() | ||
except IOError: | ||
flask.abort(404) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(debug=True) |