chiark / gitweb /
Default cursor is LH one
[ypp-sc-tools.web-live.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 --upload
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#.pnm
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 This program has quite a few dependencies:
68                                                         Package (Debian etch)
69
70  - For building, C compiler and build environment       build-essential
71  - pnm library, including dev files for building        libnetpbm10-dev
72  - pnm command line utilities for image manipulation    netpbm
73  - X11 libraries, including dev files for building      libx11-dev
74  - XTEST library, including dev files for building      libxtst-dev
75  - Perl-compatible regexp library, including dev files  libpcre3-dev
76  - Tk interpreter /usr/bin/wish                         tk8.4
77  - Perl module XML::Parser                              libxml-parser-perl
78  - Perl module JSON::Parser                             libjson-perl
79  - XTEST extension in the X server                      (part of X package)
80  - Perl interpreter and basic modules                   perl (usu.installed)
81
82 On other Linux distros the packages may have different names, but
83 these should be roughly right for Debian and its derivatives.  You can
84 install them with this rune:
85   sudo apt-get install build-essential libnetpbm10-dev netpbm libx11-dev libxtst-dev libpcre3-dev tk8.4 libxml-parser-perl libjson-perl
86
87
88 The supplied helper programs
89   dictionary-manager
90   commod-results-processor
91   database-info-fetch
92 must (currently) also be in the current working directory when you run
93 the main ypp-commodities program.
94
95 The data files (see README.files) are also left in the current working
96 directory.  There is notyet any feature to have the data files and
97 helpers be somewhere else.
98
99
100 Reporting problems
101 ------------------
102
103 If you need to report a bug, for example an inability to recognise,
104 please be sure to remember the exact error message and circumstances.
105 Also, for recognition problems there will probably be a very useful
106 screenshot file called `#pages#.pnm'.  This is likely to be very large
107 so don't just email it to me, but if you can put it up on a webpage
108 for me to download that will help.  At least keep a copy of it.
109
110 If the problem is a failure to cope with some particular YPP client
111 display and is reproducible, try running:
112    ./ypp-commodities --raw-tsv --single-page
113 If this reproduces the problem, please email me the screenshot file
114 #pages#.pnm, which will consist only of the single screen, plus the
115 error messasge.  I'll then be able to understand what's wrong,
116 hopefully.
117
118
119 Privacy
120 -------
121
122 The main purpose of this program is to connect to the PCTB server and
123 upload data.  It will do that if you run it with --upload.
124
125 This program will also, by default, talk to the dictionary server I
126 have set up: to download updated image dictionaries, and to upload new
127 dictionary entries which you create with the PCTB client dictionary
128 GUI.  This feature is mentioned in and controllable in the GUI itself,
129 so it won't happen without you knowing about it.
130
131 The uploads will by default mention your ocean and pirate name; if you
132 don't want that, pass the --dict-anon option, or untick the box in the
133 GUI.
134
135 See README.privacy for full details.
136
137
138
139  - Ian Jackson
140    ijackson@chiark.greenend.org.uk
141    Aristarchus on the Midnight ocean