<commit_before>#include <SPI.h>
#include <Ethernet.h>
#include <Phant.h>
 
char server[] = "data.sparkfun.com";
Phant phant("data.sparkfun.com", "public_key", "private_key");
int randNumber;
int randNumber2;
int randNumber3;
int randNumber4;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// the dns server ip
IPAddress dnServer(192, 168, 1, 254);
// the router's gateway address:
IPAddress gateway(192, 168, 1, 254);
// the subnet:
IPAddress subnet(255, 255, 255, 0);
//the IP address is dependent on your network
IPAddress ip(192, 168, 1, 23);

EthernetClient client;

void setup() {
  Serial.begin(9600);
  delay(2000);
  // initialize the ethernet device
  Ethernet.begin(mac, ip, dnServer, gateway, subnet);
  //print out the IP address
  Serial.print("IP = ");
  Serial.println(Ethernet.localIP());
  randomSeed(analogRead(0));
}
 
void loop() {
  randNumber = random(300);
  randNumber2 = random(300);
  randNumber3 = random(300);
  randNumber4 = random(300);

  Serial.println("Starting...");
  httppost();
  Serial.println("disconnecting.");
  client.stop();
  delay(10000);
  
}

void httppost()
{
  //if (!(client.connect(server, 80)))
  if (client.connect(server, 80))
  {
    phant.add("light", "Random Numbers:");
    phant.add("random1", randNumber4);
    phant.add("random2", randNumber3);
    phant.add("room", randNumber2);
    phant.add("temp", randNumber);
    client.println(phant.post());
    
    Serial.println("----POSTED TEST URL:----");
    //Serial.println(phant.url());
        
    //Serial.println("----POSTED POST:----");
    //Serial.println(phant.post());
    
    //client.println(phant.post());
  }
  else
  {
    Serial.println("Nothing happening...");
  }
}
<commit_msg>Prepare Ethernet sketch for HeaderKey.h file<commit_after>#include <SPI.h>
#include <Ethernet.h>
#include <Phant.h>
 
#include "HeaderKey.h"

const char public_key = PHANT_PUBLIC_KEY;
const char private_key = PHANT_PRIVATE_KEY;


char server[] = "data.sparkfun.com";
Phant phant("data.sparkfun.com", public_key, private_key);
int randNumber;
int randNumber2;
int randNumber3;
int randNumber4;

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// the dns server ip
IPAddress dnServer(192, 168, 1, 254);
// the router's gateway address:
IPAddress gateway(192, 168, 1, 254);
// the subnet:
IPAddress subnet(255, 255, 255, 0);
//the IP address is dependent on your network
IPAddress ip(192, 168, 1, 23);

EthernetClient client;

void setup() {
  Serial.begin(9600);
  delay(2000);
  // initialize the ethernet device
  Ethernet.begin(mac, ip, dnServer, gateway, subnet);
  //print out the IP address
  Serial.print("IP = ");
  Serial.println(Ethernet.localIP());
  randomSeed(analogRead(0));
}
 
void loop() {
  randNumber = random(300);
  randNumber2 = random(300);
  randNumber3 = random(300);
  randNumber4 = random(300);

  Serial.println("Starting...");
  httppost();
  Serial.println("disconnecting.");
  client.stop();
  delay(10000);
  
}

void httppost()
{
  //if (!(client.connect(server, 80)))
  if (client.connect(server, 80))
  {
    phant.add("light", "Random Numbers:");
    phant.add("random1", randNumber4);
    phant.add("random2", randNumber3);
    phant.add("room", randNumber2);
    phant.add("temp", randNumber);
    client.println(phant.post());
    
    Serial.println("----POSTED TEST URL:----");
    //Serial.println(phant.url());
        
    //Serial.println("----POSTED POST:----");
    //Serial.println(phant.post());
    
    //client.println(phant.post());
  }
  else
  {
    Serial.println("Nothing happening...");
  }
}

{'fraction_non_alphanumeric': 0.17680022415242364, 'fraction_numerical': 0.04819277108433735, 'mean_word_length': 3.741035856573705, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2202674', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1248, 'n_words': 287}