chiark / gitweb /
185a022ec3665e0fb3b58377b999f78139d7f747
[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.
84
85 The supplied helper programs
86   dictionary-manager
87   commod-results-processor
88   database-info-fetch
89 must (currently) also be in the current working directory when you run
90 the main ypp-commodities program.
91
92 The data files (see README.files) are also left in the current working
93 directory.  There is notyet any feature to have the data files and
94 helpers be somewhere else.
95
96
97 Reporting problems
98 ------------------
99
100 If you need to report a bug, for example an inability to recognise,
101 please be sure to remember the exact error message and circumstances.
102 Also, for recognition problems there will probably be a very useful
103 screenshot file called `#pages#.pnm'.  This is likely to be very large
104 so don't just email it to me, but if you can put it up on a webpage
105 for me to download that will help.  At least keep a copy of it.
106
107 If the problem is a failure to cope with some particular YPP client
108 display and is reproducible, try running:
109    ./ypp-commodities --raw-tsv --single-page
110 If this reproduces the problem, please email me the screenshot file
111 #pages#.pnm, which will consist only of the single screen, plus the
112 error messasge.  I'll then be able to understand what's wrong,
113 hopefully.
114
115
116 Privacy
117 -------
118
119 The main purpose of this program is to connect to the PCTB server and
120 upload data.  It will do that if you run it with --upload.
121
122 This program will also, by default, talk to the dictionary server I
123 have set up: to download updated image dictionaries, and to upload new
124 dictionary entries which you create with the PCTB client dictionary
125 GUI.  This feature is mentioned in and controllable in the GUI itself,
126 so it won't happen without you knowing about it.
127
128 The uploads will by default mention your ocean and pirate name; if you
129 don't want that, pass the --dict-anon option, or untick the box in the
130 GUI.
131
132 See README.privacy for full details.
133
134
135
136  - Ian Jackson
137    ijackson@chiark.greenend.org.uk
138    Aristarchus on the Midnight ocean