<commit_before>/*
 */
var blinkstick = require('blinkstick');

exports.index = function(req, res) {
  var led = blinkstick.findFirst();

  if (typeof req.query.op === 'undefined') {
    res.send({ status: 'ERR' });
  }
  else
  if (req.query.op == 'random') {
    led.setColor('random', function () {
      res.send({ status: 'OK' });
    });
  }
  else
  if (req.query.op == 'off') {
    led.turnOff();
    res.send({ status: 'OK' });
  }
  else
  if (req.query.op == 'pulse') {
    led.pulse(req.query.rgb, function () {
      res.send({ status: 'OK' });
    });
  }
  else
  if (req.query.op == 'blink') {
    led.blink(req.query.rgb, function () {
      res.send({ status: 'OK' });
    });
  }
  else {
    led.setColor(req.query.op, function () {
      res.send({ status: 'OK' });
    });
  }
};

export.clock = function(req, res) {
  res.render('blinkstick/edit');  <commit_msg>Modified blinkstick.js<commit_after>/*
 */
var blinkstick = require('blinkstick');

exports.index = function(req, res) {
  var led = blinkstick.findFirst();

  if (typeof req.query.op === 'undefined') {
    res.send({ status: 'ERR' });
  }
  else
  if (req.query.op == 'random') {
    led.setColor('random', function () {
      res.send({ status: 'OK' });
    });
  }
  else
  if (req.query.op == 'off') {
    led.turnOff();
    res.send({ status: 'OK' });
  }
  else
  if (req.query.op == 'pulse') {
    led.pulse(req.query.rgb, function () {
      res.send({ status: 'OK' });
    });
  }
  else
  if (req.query.op == 'blink') {
    led.blink(req.query.rgb, function () {
      res.send({ status: 'OK' });
    });
  }
  else {
    led.setColor(req.query.op, function () {
      res.send({ status: 'OK' });
    });
  }
};

export.clock = function(req, res) {
  res.render('blinkstick/clock');  
{'fraction_non_alphanumeric': 0.218785151856018, 'fraction_numerical': 0.0, 'mean_word_length': 2.565130260521042, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1259220', 'n_tokens_mistral': 671, 'n_tokens_neox': 664, 'n_words': 125}