5 - screenscrape the commodities trading screen
6 - produce the results as a tab separated values file
7 - **TODO** upload the results to PCTB
9 To run it, change to this directory, type `make', and then:
10 ./ypp-commodities --tsv >commods.tsv
12 While it is capturing the screenshots, do not move the mouse or use
13 the keyboard. Keyboard focus must stay in the YPP client window.
19 Setting the operation mode:
20 --find-window-only Just check that we can find the YPP client window.
21 --screenshot-only Page through and take screenshots, do not OCR
22 --analyse-only | --same Process previously taken screenshots
23 --everything (default) Take screenshots and process them
25 Options to vary the processing:
26 --single-page One screenful, no paging - results will be incomplete
27 --quiet Suppress progress messages
28 --screenshot-file F Store or read screenshots in F rather than #pages#.pnm
29 --window-id ID Specified X window is the YPP client - do not search
30 --edit-charset Enable character set editing. See README.charset.
32 Controlling what happens to the results:
33 --upload (default) Upload to the PCTB server
34 --tsv Print data as clean tab-separated-values file
35 --raw-tsv Dump the raw (not deduped, unsorted) OCR'd data
36 --best-prices Print best buy and sell price for each commodity
37 --arbitrage Print arbitrage opportunities
40 Files we use and update
41 -----------------------
43 The program reads and writes the following files:
47 Contains one or more images (as raw ppms, end-to-end) which are the
48 screenshots taken in the last run. This is (over)written whenever
49 we take screenshots from the YPP client. You can reprocess an
50 existing set of screenshots with the --same (aka --analyse-only)
51 option; in that case we just read the screenshots file.
53 You can specify a different file with --screenshot-file.
55 If you want to display the contents of this file, `display' can do
56 it. Don't try `display vid:#pages#.pnm' as this will consume
57 truly stupendous quantities of RAM - it wedged my laptop.
61 Character set database. For the semantics of the contents of this
62 file see README.charset. There is not currently any accurate
63 documentation of this database format.
65 If you delete this file you'll have to re-enter a lot of glyph data
66 (and probably get it wrong and make the program misrecognise
67 things). If you want to undo any mistakes you may have made
68 answering OCR questions you can safely revert this to the version
73 Map from commodity names to the numbers required by the PCTB
74 server. This is fetched and updated automatically as necessary.
75 It can safely be deleted as it will then be refetched.
78 When any of these tools overwrite one of the persistent database
79 files, they temporarily write to <file>.new.
81 These files are all in the current working directory. There is not
82 yet any feature to have them be somewhere else. The helper programs
84 yppsc-commod-processor
85 must (currently) also be in the current directory.
87 Future versions may have more helpers and more data files.
90 Installation requirements
91 -------------------------
93 This program has quite a few dependencies:
96 - For building, C compiler and build environment build-essential
97 - pnm library, including dev files for building libnetpbm10-dev
98 - pnm command line utilities for image manipulation netpbm
99 - X11 libraries, including dev files for building libx11-dev
100 - XTEST library, including dev files for building libxtst-dev
101 - Tk interpreter /usr/bin/wish tk8.4
102 - Perl module XML::Parser libxml-parser-perl
103 - Perl module JSON::Parser libjson-perl
104 - XTEST extension in the X server (part of X package)
105 - Perl interpreter and basic modules perl (usu.installed)
107 On other Linux distros the packages may have different names, but
108 these should be roughly right for Debian and its derivatives.
114 If you need to report a bug, for example an inability to recognise,
115 please be sure to remember the exact error message and circumstances.
116 Also, for recognition problems there will probably be a very useful
117 screenshot file called `#pages#.pnm'. This is likely to be very large
118 so don't just email it to me, but if you can put it up on a webpage
119 for me to download that will help. At least keep a copy of it.
121 If the problem is a failure to cope with some particular YPP client
122 display and is reproducible, try running:
123 ./ypp-commodities --raw-tsv --single-page
124 If this reproduces the problem, please email me the screenshot file
125 #pages#.pnm, which will consist only of the single screen, plus the
126 error messasge. I'll then be able to understand what's wrong,
130 Phoning home - privacy
131 ----------------------
133 The main purpose of this program is to connect to the PCTB server and
134 upload data. The program does not currently phone home at all in
135 modes other than --upload, and when it does it connects to the
136 PCTB server not to a system of mine.
138 However, there are some improvements which I may introduce in the
139 future which may change this. I am considering:
141 * Having the ocr character resolver talk to a server run by me
142 to look for missing glpyhs, and/or upload those glyphs back
143 to that server so that they can be shared.
145 * Having the upload client upload a copy of the data to a server run
146 by me, when run in --upload mode.
148 If I do do this these new functions may be enabled by default, but it
149 will be possible to turn them off, or direct them to different
150 servers, with command-line options, and they will be documented here.
154 ijackson@chiark.greenend.org.uk
155 Aristarchus on the Midnight ocean