<commit_before><?php

/*

All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.

---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org

*/

global $user, $path, $session;

?>

<h2><?php echo _("Feed API");?></h2>

<h3><?php echo _('Apikey authentication'); ?></h3>
<p><?php echo _('If you want to call any of the following actions when your not logged in, add an apikey to the URL of your request: &apikey=APIKEY.'); ?></p>
<form class="form-horizontal" role="form">
    <div class="form-group">
        <label for="readonlyapi" class="col-sm-4 control-label"><b><?php echo _('Read only:'); ?></b></label>
        <div class="col-sm-4">
            <p type="text" class="form-control" id="readonlyapi"><?php echo $user->get_apikey_read($session['userid']); ?></p>
        </div>
    </div>
    <div class="form-group">
        <label for="writeyapi" class="col-sm-4 control-label"><b><?php echo _('Read & Write:'); ?></b></label>
        <div class="col-sm-4">
            <p type="text" class="form-control" id="writeyapi"><?php echo $user->get_apikey_write($session['userid']); ?><p/>
            </div>
        </div>
    </div>
</form>
<h3><?php echo _("Html");?></h3>
<p><a href="<?php echo $path; ?>feed/list"><?php echo $path; ?>feed/list</a> - <?php echo _("The feed list view");?></p>
<p><a href="<?php echo $path; ?>feed/api"><?php echo $path; ?>feed/api</a> - <?php echo _("This page");?></p>

<h3><?php echo _("JSON");?></h3>
<p><?php echo _("To use the json api the request url needs to include .json");?></p>
<p><a href="<?php echo $path; ?>feed/list.json?userid=0"><?php echo $path; ?>feed/list.json?userid=0</a> - <?php echo _("returns a list of public feeds made public by the given user.");?></p>
<p><a href="<?php echo $path; ?>feed/value.json?id=0"><?php echo $path; ?>feed/value.json?id=0</a> - <?php echo _("returns the present value of a given feed");?></p>
<p><a href="<?php echo $path; ?>feed/get.json?id=0&field="><?php echo $path; ?>feed/get.json?id=0&field=</a> - <?php echo _("returns the present value of a given feed");?></p>
<p><a href="<?php echo $path; ?>feed/data.json?id=0&start=&end=&dp="><?php echo $path; ?>feed/data.json?id=0&start=&end=&dp=</a> - <?php echo _("returns feed data");?></p>
<p><a href="<?php echo $path; ?>feed/histogram.json?id=0&start=&end="><?php echo $path; ?>feed/histogram.json?id=0&start=&end=</a> - <?php echo _("returns histogram data");?></p>
<p><a href="<?php echo $path; ?>feed/kwhatpower.json?id=0&min=&max="><?php echo $path; ?>feed/kwhatpower.json?id=0&min=&max=</a> - <?php echo _("returns kwh consumed in a given power band using histogram data type");?></p>

<p><a href="<?php echo $path; ?>feed/getid.json?name="><?php echo $path; ?>feed/getid.json?name=</a> - <?php echo _("returns id of a feed given by name");?></p>
<p><a href="<?php echo $path; ?>feed/list.json"><?php echo $path; ?>feed/list.json</a></p>

<p><a href="<?php echo $path; ?>feed/create.json?name=&type="><?php echo $path; ?>feed/create.json?name=&type=</a></p>

<p><a href="<?php echo $path; ?>feed/set.json?id=0&fields={'name':'anewname'}"><?php echo $path; ?>feed/set.json?id=0&fields={'name':'anewname'}</a></p>
<p><a href="<?php echo $path; ?>feed/insert.json?id=0&time=UNIXTIME&value=100.0"><?php echo $path; ?>feed/insert.json?id=0&time=UNIXTIME&value=100.0</a></p>
<p><a href="<?php echo $path; ?>feed/update.json?id=0&time=UNIXTIME&value=100.0"><?php echo $path; ?>feed/update.json?id=0&time=UNIXTIME&value=100.0</a></p>
<p><a href="<?php echo $path; ?>feed/deletedatapoint.json?id=0&feedtime=UNIXTIME"><?php echo $path; ?>feed/deletedatapoint.json?id=0&feedtime=UNIXTIME</a></p>
<p><a href="<?php echo $path; ?>feed/delete.json?id=0"><?php echo $path; ?>feed/delete.json?id=0</a></p>
<commit_msg>feedapi_view cosmetic change<commit_after><?php

/*

All Emoncms code is released under the GNU Affero General Public License.
See COPYRIGHT.txt and LICENSE.txt.

---------------------------------------------------------------------
Emoncms - open source energy visualisation
Part of the OpenEnergyMonitor project:
http://openenergymonitor.org

*/

global $user, $path, $session;

?>

<h2><?php echo _("Feed API");?></h2>
<div class="container">
    <h3><?php echo _('Apikey authentication'); ?></h3>
    <p><?php echo _('If you want to call any of the following actions when your not logged in, add an apikey to the URL of your request: &apikey=APIKEY.'); ?></p>
    <form class="form-horizontal" role="form">
        <div class="form-group">
            <label for="readonlyapi" class="col-sm-4 control-label"><b><?php echo _('Read only:'); ?></b></label>
            <div class="col-sm-4">
                <p type="text" class="form-control" id="readonlyapi"><?php echo $user->get_apikey_read($session['userid']); ?></p>
            </div>
        </div>
        <div class="form-group">
            <label for="writeyapi" class="col-sm-4 control-label"><b><?php echo _('Read & Write:'); ?></b></label>
            <div class="col-sm-4">
                <p type="text" class="form-control" id="writeyapi"><?php echo $user->get_apikey_write($session['userid']); ?><p/>
                </div>
            </div>
        </div>
    </form>
    <h3><?php echo _("Html");?></h3>
    <p><a href="<?php echo $path; ?>feed/list"><?php echo $path; ?>feed/list</a> - <?php echo _("The feed list view");?></p>
    <p><a href="<?php echo $path; ?>feed/api"><?php echo $path; ?>feed/api</a> - <?php echo _("This page");?></p>

    <h3><?php echo _("JSON");?></h3>
    <p><?php echo _("To use the json api the request url needs to include .json");?></p>
    <p><a href="<?php echo $path; ?>feed/list.json?userid=0"><?php echo $path; ?>feed/list.json?userid=0</a> - <?php echo _("returns a list of public feeds made public by the given user.");?></p>
    <p><a href="<?php echo $path; ?>feed/value.json?id=0"><?php echo $path; ?>feed/value.json?id=0</a> - <?php echo _("returns the present value of a given feed");?></p>
    <p><a href="<?php echo $path; ?>feed/get.json?id=0&field="><?php echo $path; ?>feed/get.json?id=0&field=</a> - <?php echo _("returns the present value of a given feed");?></p>
    <p><a href="<?php echo $path; ?>feed/data.json?id=0&start=&end=&dp="><?php echo $path; ?>feed/data.json?id=0&start=&end=&dp=</a> - <?php echo _("returns feed data");?></p>
    <p><a href="<?php echo $path; ?>feed/histogram.json?id=0&start=&end="><?php echo $path; ?>feed/histogram.json?id=0&start=&end=</a> - <?php echo _("returns histogram data");?></p>
    <p><a href="<?php echo $path; ?>feed/kwhatpower.json?id=0&min=&max="><?php echo $path; ?>feed/kwhatpower.json?id=0&min=&max=</a> - <?php echo _("returns kwh consumed in a given power band using histogram data type");?></p>

    <p><a href="<?php echo $path; ?>feed/getid.json?name="><?php echo $path; ?>feed/getid.json?name=</a> - <?php echo _("returns id of a feed given by name");?></p>
    <p><a href="<?php echo $path; ?>feed/list.json"><?php echo $path; ?>feed/list.json</a></p>

    <p><a href="<?php echo $path; ?>feed/create.json?name=&type="><?php echo $path; ?>feed/create.json?name=&type=</a></p>

    <p><a href="<?php echo $path; ?>feed/set.json?id=0&fields={'name':'anewname'}"><?php echo $path; ?>feed/set.json?id=0&fields={'name':'anewname'}</a></p>
    <p><a href="<?php echo $path; ?>feed/insert.json?id=0&time=UNIXTIME&value=100.0"><?php echo $path; ?>feed/insert.json?id=0&time=UNIXTIME&value=100.0</a></p>
    <p><a href="<?php echo $path; ?>feed/update.json?id=0&time=UNIXTIME&value=100.0"><?php echo $path; ?>feed/update.json?id=0&time=UNIXTIME&value=100.0</a></p>
    <p><a href="<?php echo $path; ?>feed/deletedatapoint.json?id=0&feedtime=UNIXTIME"><?php echo $path; ?>feed/deletedatapoint.json?id=0&feedtime=UNIXTIME</a></p>
<p><a href="<?php echo $path; ?>feed/delete.json?id=0"><?php echo $path; ?>feed/delete.json?id=0</a></p>
</div>

{'fraction_non_alphanumeric': 0.2592914853946551, 'fraction_numerical': 0.012430080795525171, 'mean_word_length': 4.265706806282722, 'pattern_counts': {'":': 0, '<': 307, '<?xml version=': 0, '>': 311, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3849715', 'n_tokens_mistral': 2912, 'n_tokens_neox': 2953, 'n_words': 689}