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>
148 <div class="container footer">
149 <a href="http://cweiske.de/phancap.htm">phancap</a>,
150 the self-hosted website screenshot service is available under the
151 <a href="http://www.gnu.org/licenses/agpl-3.0.html">
152 <abbr title="GNU Affero General Public License">AGPL</abbr></a>.