3 * Give information about phancap
9 * @author Christian Weiske <cweiske@cweiske.de>
10 * @copyright 2014 Christian Weiske
11 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12 * @link http://cweiske.de/phancap.htm
15 header('HTTP/1.0 500 Internal Server Error');
17 if (file_exists(__DIR__ . '/../src/phancap/Autoloader.php')) {
18 include_once __DIR__ . '/../src/phancap/Autoloader.php';
19 Autoloader::register();
21 include_once 'phancap/Autoloader.php';
23 header('HTTP/1.0 200 OK');
25 $options = new Options();
26 $config = new Config();
29 $options->setConfig($config);
30 } catch (\Exception $e) {
34 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
36 <title>phancap</title>
38 <link rel="stylesheet" href="css/bootstrap.min.css"/>
39 <link rel="stylesheet" href="css/bootstrap-theme.min.css"/>
40 <link rel="stylesheet" href="css/phancap.css"/>
41 <meta name="viewport" content="width=device-width, initial-scale=1"/>
44 <div class="container">
46 <div class="col-md-2"></div>
47 <div class="col-md-8">
49 <div class="page-header">
54 <div class="col-md-6">
56 Web service to create website screenshots.
60 <div class="col-md-6">
62 <div class="panel panel-default">
63 <div class="panel-heading">Create screenshot</div>
64 <div class="panel-body">
65 <?php if ($config->access === false) { ?>
66 <div class="alert alert-danger">API is disabled</div>
67 <?php } else if ($config->access !== true) { ?>
68 <div class="alert alert-warning">API requires authentication</div>
70 <form method="get" action="./get.php" class="form-inline">
71 <div class="form-group">
72 <label for="url">URL:</label>
73 <input type="text" name="url" id="url" class="form-control"
74 placeholder="http://example.org/" />
76 <button type="submit" class="btn btn-default">Go</button>
85 <h2 id="tools">Tools</h2>
86 <ul class="list-group">
87 <li class="list-group-item">
88 <a href="setup.php">Setup check</a> to test if everything is ok
90 <li class="list-group-item">
91 <a href="README.html">README</a>
98 The API is accessible at <a href="get.php">get.php</a>.
101 <div class="panel panel-default">
102 <div class="panel-heading" style="text-align: center">
103 Available URL parameters
105 <table class="table table-striped table-bordered table-condensed">
116 foreach ($options->options as $name => $option) {
118 . '<td><var>' . $name . '</var></td>'
119 . '<td>' . htmlspecialchars($option['title']) . '</td>'
122 is_array($option['type'])
123 ? ('One of: <kbd>' . implode('</kbd>, <kbd>', $option['type']) . '</kbd>')
124 : str_replace('skip', ' ', $option['type'])
127 . '<td> <kbd>' . $option['default'] . '</kbd></td>'
135 Ages can be given as ISO 8601 duration specification, for example:
137 <dl class="dl-horizontal">
138 <dt><kbd>P1Y</kbd></dt><dd>1 year</dd>
139 <dt><kbd>P2W</kbd></dt><dd>2 weeks</dd>
140 <dt><kbd>P1D</kbd></dt><dd>1 day</dd>
141 <dt><kbd>PT4H</kbd></dt><dd>4 hours</dd>
145 <h2 id="complex">Complex request</h2>
146 <form method="get" action="./get.php" class="form-horizontal">
147 <div class="form-group">
148 <label for="url2" class="col-sm-3 control-label">URL</label>
149 <div class="col-sm-9">
150 <input type="text" name="url" id="url2" class="form-control"
151 placeholder="http://example.org/" />
155 <div class="form-group">
156 <label class="col-sm-3 control-label">Mode</label>
157 <div class="col-sm-9">
158 <label class="radio-inline">
159 <input type="radio" name="smode" value="screen" checked="checked"/> screen
161 <label class="radio-inline">
162 <input type="radio" name="smode" value="page"/> page
167 <div class="form-group">
168 <label class="col-sm-3 control-label">Format</label>
169 <div class="col-sm-9">
170 <label class="radio-inline">
171 <input type="radio" name="sformat" value="png" checked="checked"/> png
173 <label class="radio-inline">
174 <input type="radio" name="sformat" value="jpg"/> jpg
176 <label class="radio-inline">
177 <input type="radio" name="sformat" value="pdf"/> pdf
182 <div class="form-group">
183 <label class="col-sm-3 control-label">Browser size</label>
184 <div class="col-sm-9">
186 <div class="col-xs-3">
187 <input type="number" name="bwidth" class="form-control"
188 placeholder="width"/>
190 <div class="col-xs-3">
191 <input type="number" name="bheight" class="form-control"
192 placeholder="height"/>
198 <div class="form-group">
199 <label class="col-sm-3 control-label">Screenshot size</label>
200 <div class="col-sm-9">
202 <div class="col-xs-3">
203 <input type="number" name="swidth" class="form-control"
204 placeholder="width"/>
206 <div class="col-xs-3">
207 <input type="number" name="sheight" class="form-control"
208 placeholder="height"/>
214 <div class="form-group">
215 <label for="smaxage" class="col-sm-3 control-label">Maximum age</label>
216 <div class="col-sm-9">
218 <div class="col-xs-2">
219 <input type="text" name="smaxage" id="smaxage" class="form-control"
226 <div class="form-group">
227 <div class="col-sm-offset-3 col-sm-9">
228 <button type="submit" class="btn btn-primary">Create screenshot</button>
237 <div class="container footer">
238 <a href="http://cweiske.de/phancap.htm">phancap</a>,
239 the self-hosted website screenshot service is available under the
240 <a href="http://www.gnu.org/licenses/agpl-3.0.html">
241 <abbr title="GNU Affero General Public License">AGPL</abbr></a>.