aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2016-04-05 23:12:13 +0200
committerPetter Reinholdtsen <pere@hungry.com>2016-04-05 23:12:13 +0200
commit9fe35026d89d2b99df4a772579babfffb7e0148a (patch)
tree6f2d479984940b8a7425963bc3a4d8f3edb4e861
parent889fc09ed62f98f1b30507efd5777ca1e05c5b6e (diff)
Update the setup instructions and add a title.
-rw-r--r--README14
-rwxr-xr-xenv-setup18
2 files changed, 26 insertions, 6 deletions
diff --git a/README b/README
index fda108e..53582c1 100644
--- a/README
+++ b/README
@@ -1,3 +1,6 @@
+Scrapers for norweigan post journal sources
+===========================================
+
Classic API code available from
https://bitbucket.org/ScraperWiki/scraperwiki-classic/src/c7f076950476?at=default
@@ -8,13 +11,12 @@ Standalone lib https://github.com/scraperwiki/scraperwiki-python
== Running / testing scrapers ==
-In addition to checking out the repo, the following is required to test or
-run most scrapers:
+To get the scrapers running, one need to set up the data directory and
+a patched copy of the scraperwiki-python project. The script
+env-setup is provided to do so. Run it from the top of the checked
+out scraper directory to set up your own copy.
-mkdir data
-scp -r 'scraper.nuug.no:/srv/scraper/postjournaler/testlib/*' .
-apt-get install python-alembic python-beautifulsoup python-dateutil
-cp scrapersources/postliste-python-lib scrapersources/postliste-python-lib.py
+ ./env-setup
To run a scraper, use the run-scraper command and give the scraper
name as the argument. For example like this:
diff --git a/env-setup b/env-setup
new file mode 100755
index 0000000..e4987f4
--- /dev/null
+++ b/env-setup
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Set up the local scraperwiki python library
+if [ ! -d testlib ] ; then
+ mkdir testlib
+ git clone https://github.com/petterreinholdtsen/scraperwiki-python.git \
+ testlib/scraperwiki-python
+ (cd testlib/scraperwiki-python; git checkout -b localbranch)
+ (cd testlib/scraperwiki-python; git merge -m "Merge patches." origin/scraperwiki.swimport \
+ origin/sqliteerror origin/verbose-sqlite)
+fi
+
+# Install the rest
+sudo apt-get install python-alembic python-beautifulsoup python-dateutil
+if [ ! -h scrapersources/postliste-python-lib.py ] ; then
+ ln -s postliste-python-lib scrapersources/postliste-python-lib.py
+fi
+mkdir -p data