<commit_before># Description:
#   Generate QR codes as PNG with size 128x128 pixels
#   Using service from [QR Code Generator](http://goqr.me/api/doc/create-qr-code/)
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hubot qr gen <data>
#
# Author:
#   eelcokoelewijn


# http(s)://api.qrserver.com/v1/create-qr-code/?data=[URL-encoded-text]&size=[pixels]x[pixels]
module.exports = (robot) ->
 robot.respond /qr gen (.+)/i, (msg) ->
  data = msg.match[1]
  msg.send "https://api.qrserver.com/v1/create-qr-code/?data=#{encodeURIComponent(data)}&size=128x128"<commit_msg>Add check for maximum data length of 900 characters<commit_after># Description:
#   Generate QR codes as PNG with size 128x128 pixels
#   Using service from [QR Code Generator](http://goqr.me/api/doc/create-qr-code/)
#
# Dependencies:
#   None
#
# Configuration:
#   None
#
# Commands:
#   hubot qr gen <data>
#
# Author:
#   eelcokoelewijn


# http(s)://api.qrserver.com/v1/create-qr-code/?data=[URL-encoded-text]&size=[pixels]x[pixels]
#Nevertheless up to 900 characters should work in general.
module.exports = (robot) ->
 robot.respond /qr gen (.+)/i, (msg) ->
  data = msg.match[1]
  if data.length > 900
   msg.send "Maximum length for data is 900 characters"
   return null
  else
   msg.send "https://api.qrserver.com/v1/create-qr-code/?data=#{encodeURIComponent(data)}&size=128x128"
{'fraction_non_alphanumeric': 0.16124367317425886, 'fraction_numerical': 0.03036876355748373, 'mean_word_length': 3.996389891696751, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '7114710', 'n_tokens_mistral': 568, 'n_tokens_neox': 509, 'n_words': 110}