<commit_before>#!/usr/bin/php
<?php
/* This software copyright 2017 by Thundersun, Inc..
 * You may use it according to the terms of the accompanying license.
 * 
 * This script loops through a CSV file and uploads it to your EmonCMS server.
 */
// An assortment of defaults.
$host_em = new Host([
	'url'=>'http://em/emoncms/input/post.json', 
	'api'=>'eb1934dd930439f892fd446e8944b46e', 
	'uspw'=>'atat:bb'
	]);

G::$host = $host_em;

G::$settings = new Settings([
	// Actions
	'Flooper' =>6, // Makes the values be a multiple of 10 kW
	// Settings
	'InputFile' => "m30.csv",
	'Serial' => "001EC6000783",
	'SubDevice' => "mb250",
	'TimeCol' =>0,
	'DataCol' =>4,
	'NodeNum' =>1
	]);

<commit_msg>better comments<commit_after>#!/usr/bin/php
<?php
/* Copyright 2017 by Thundersun, Inc.
 * You may use it according to the terms of the accompanying license.
 * 
 * WHAT IS IT?
 * This script interacts with your EmonCMS server.  Among other things, it:
 * - pushes a random value at a specified interval, for testing live updates.
 * - bulk uploads a CSV including a PHP-comprehensible datetime and a number, in some column.
 * 
 * 
 * TODO:
 * - make the commandline options match the settings class.
 * 
 */
// An assortment of defaults.
$host_em = new Host([
	'url'=>'http://em/emoncms/input/post.json', 
	'api'=>'eb1934dd930439f892fd446e8944b46e', 
	'uspw'=>'atat:bb'
	]);

G::$host = $host_em;

G::$settings = new Settings([
	// Actions
	'Flooper' =>6, // Makes the values be a multiple of 10 kW
	// Settings
	'InputFile' => "m30.csv",
	'Serial' => "001EC6000783",
	'SubDevice' => "mb250",
	'TimeCol' =>0,
	'DataCol' =>4,
	'NodeNum' =>1
	]);


{'fraction_non_alphanumeric': 0.16058394160583941, 'fraction_numerical': 0.057177615571776155, 'mean_word_length': 3.754335260115607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '6831445', 'n_tokens_mistral': 671, 'n_tokens_neox': 589, 'n_words': 184}