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) {
33 <?xml version="1.0" encoding="utf-8"?>
34 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
35 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
37 <title>phancap</title>
39 <link rel="stylesheet" href="css/bootstrap.min.css"/>
40 <link rel="stylesheet" href="css/bootstrap-theme.min.css"/>
41 <link rel="stylesheet" href="css/phancap.css"/>
42 <meta name="viewport" content="width=device-width, initial-scale=1"/>
45 <div class="container">
47 <div class="col-md-2"></div>
48 <div class="col-md-8">
50 <div class="page-header">
55 <div class="col-md-6">
57 Web service to create website screenshots.
61 <div class="col-md-6">
63 <div class="panel panel-default">
64 <div class="panel-heading">Create screenshot</div>
65 <div class="panel-body">
66 <?php if ($config->access === false) { ?>
67 <div class="alert alert-danger">API is disabled</div>
68 <?php } else if ($config->access !== true) { ?>
69 <div class="alert alert-warning">API requires authentication</div>
71 <form method="get" action="./get.php" class="form-inline" role="form">
72 <div class="form-group">
73 <label for="url">URL:</label>
74 <input type="text" name="url" id="url" size="30" class="form-control"
75 placeholder="http://example.org/" />
77 <button type="submit" class="btn btn-default">Go</button>
86 <h2 id="tools">Tools</h2>
87 <ul class="list-group">
88 <li class="list-group-item">
89 <a href="setup.php">Setup check</a> to test if everything is ok
91 <li class="list-group-item">
92 <a href="README.html">README</a>
99 The API is accessible at <a href="get.php">get.php</a>.
102 <div class="panel panel-default">
103 <div class="panel-heading" style="text-align: center">
104 Available URL parameters
106 <table class="table table-striped table-bordered table-condensed">
117 foreach ($options->options as $name => $option) {
119 . '<td><tt>' . $name . '</tt></td>'
120 . '<td>' . htmlspecialchars($option['title']) . '</td>'
123 is_array($option['type'])
124 ? ('One of: <tt>' . implode('</tt>, <tt>', $option['type']) . '</tt>')
125 : str_replace('skip', ' ', $option['type'])
128 . '<td> <tt>' . $option['default'] . '</tt></td>'
136 Ages can be given as ISO 8601 duration specification, for example:
138 <dl class="dl-horizontal">
139 <dt><tt>P1Y</tt></dt><dd>1 year</dd>
140 <dt><tt>P2W</tt></dt><dd>2 weeks</dd>
141 <dt><tt>P1D</tt></dt><dd>1 day</dd>
142 <dt><tt>PT4H</tt></dt><dd>4 hours</dd>
149 <div class="container footer">
150 <a href="http://cweiske.de/phancap.htm">phancap</a>,
151 the self-hosted website screenshot service is available under the
152 <a href="http://www.gnu.org/licenses/agpl-3.0.html">
153 <abbr title="GNU Affero General Public License">AGPL</abbr></a>.