chiark / gitweb /
4ef779e8bcfb1cd072416f09fbcef01fef2bb4f8
[ypp-sc-tools.db-test.git] / pctb / README
1 Overview
2 --------
3
4 This tool can:
5   - screenscrape the commodities trading screen
6   - produce the results as a tab separated values file
7   - upload the results to PCTB
8
9 To run it, change to this directory, type `make', and then:
10   ./ypp-commodities
11 to upload to the PCTB server.   Currently we use pctb.ilk.org,
12 the testing instance of the PCTB database, pending approval from the
13 operators of the main server.
14
15 Or, for example, for a tab-separated values dump:
16   ./ypp-commodities --tsv >commods.tsv
17
18 While it is capturing the screenshots, do not move the mouse or use
19 the keyboard.  Keyboard focus must stay in the YPP client window.
20
21
22 Command-line options
23 --------------------
24
25 Setting the operation mode:
26   --find-window-only       Just check that we can find the YPP client window.
27   --screenshot-only        Page through and take screenshots, do not OCR
28   --analyse-only | --same  Process previously taken screenshots
29   --everything (default)   Take screenshots and process them
30
31 Options to vary the processing:
32   --single-page         One screenful, no paging - results will be incomplete
33   --quiet               Suppress progress messages
34   --screenshot-file F   Store or read screenshots in F rather than _pages.ppm
35   --window-id ID        Specified X window is the YPP client - do not search
36   --edit-charset        Enable character set editing.  See README.dictionary.
37   --no-edit-charset     Do not edit charset even if _local-char*.txt exists.
38   --find-island         Find and print the ocean and island.  Suppresses OCR
39                          and output unless used with result processing option.
40   --test-servers        Set default servers to be the test servers, not
41                          the real live ones (doesn't affect explicit settings).
42
43 Controlling what happens to the results - only one at a time:
44   --upload (default) Upload to the PCTB server
45   --tsv              Print data as clean tab-separated-values file
46   --raw-tsv          Dump the raw (not deduped, unsorted) OCR'd data
47   --best-prices      Print best buy and sell price for each commodity
48   --arbitrage        Print arbitrage opportunities
49
50 Privacy options, which control conversations with the dictionary server:
51   --dict-local-only  *  Do not talk to the server even to fetch new dictionary.
52   --dict-read-only   *  Only fetch new dictionary, do not submit new entries.
53   --dict-anon           Don't quote pirate name if submitting entries.
54   --dict-submit         Submit entries quoting my pirate name.  (default)
55 Please do not use options marked * with --upload.  See README.privacy.
56
57 Options to override which servers we talk to:
58   --pctb-server HOST|URL  Talk to the PCTB server at HOST or URL.
59   --dict-submit-url URL   Submit dictionary entries with HTTP POST under URL.
60   --dict-update-from SRC  Fetch updated master dictionary with rsync from SRC.
61 Or set the environment variables YPPSC_PCTB{_PCTB, _DICT_UPDATE, _DICT_SUBMIT}
62
63
64 Installation requirements
65 -------------------------
66
67 Your X server must be 24bpp (or better).
68
69 This program has quite a few dependencies:
70                                                         Package (Debian etch)
71
72  - For building, C compiler and build environment       build-essential
73  - pnm library, including dev files for building        libnetpbm10-dev
74  - pnm command line utilities for image manipulation    netpbm
75  - X11 libraries, including dev files for building      libx11-dev
76  - XTEST library, including dev files for building      libxtst-dev
77  - Perl-compatible regexp library, including dev files  libpcre3-dev
78  - Tk interpreter /usr/bin/wish                         tk8.4
79  - Perl module XML::Parser                              libxml-parser-perl
80  - Perl module JSON::Parser                             libjson-perl
81  - XTEST extension in the X server                      (part of X package)
82  - Perl interpreter and basic modules                   perl (usu.installed)
83
84 On other Linux distros the packages may have different names, but
85 these should be roughly right for Debian and its derivatives.  You can
86 install them with this rune:
87   sudo apt-get install build-essential libnetpbm10-dev netpbm libx11-dev libxtst-dev libpcre3-dev tk8.4 libxml-parser-perl libjson-perl
88
89
90 The supplied helper programs
91   dictionary-manager
92   commod-results-processor
93   database-info-fetch
94 must (currently) also be in the current working directory when you run
95 the main ypp-commodities program.
96
97 The data files (see README.files) are also left in the current working
98 directory.  There is notyet any feature to have the data files and
99 helpers be somewhere else.
100
101
102 Reporting problems
103 ------------------
104
105 If you need to report a bug, for example an inability to recognise,
106 please be sure to remember the exact error message and circumstances.
107 Also, for recognition problems there will probably be a very useful
108 screenshot file called `_pages.ppm'.  This is likely to be very large
109 so don't just email it to me, but if you can put it up on a webpage
110 for me to download that will help.  At least keep a copy of it.
111
112 If the problem is a failure to cope with some particular YPP client
113 display and is reproducible, try running:
114    ./ypp-commodities --raw-tsv --single-page
115 If this reproduces the problem, please email me the screenshot file
116 _pages.ppm, which will consist only of the single screen, plus the
117 error messasge.  I'll then be able to understand what's wrong,
118 hopefully.
119
120
121 Privacy
122 -------
123
124 The main purpose of this program is to connect to the PCTB server and
125 upload data.  It will do that if you run it with --upload.
126
127 This program will also, by default, talk to the dictionary server I
128 have set up: to download updated image dictionaries, and to upload new
129 dictionary entries which you create with the PCTB client dictionary
130 GUI.  This feature is mentioned in and controllable in the GUI itself,
131 so it won't happen without you knowing about it.
132
133 The uploads will by default mention your ocean and pirate name; if you
134 don't want that, pass the --dict-anon option, or untick the box in the
135 GUI.
136
137 See README.privacy for full details.
138
139
140
141  - Ian Jackson
142    ijackson@chiark.greenend.org.uk
143    Aristarchus on the Midnight ocean