<commit_before>![Aptible, Inc.](http://aptible-media-assets-manual.s3.amazonaws.com/web-horizontal-350.png)

#Minitron
_________

_Minitron.rb_ is a zendesk-to-segment webhook-based integration.

Each time a ticket status changes to `Closed`, a zendesk trigger hits the sinatra app endpoint with an ID and a status.  The app then uses that ID to query the zendesk api for ticket and ticket_metric data which is forwarded on to segment.

###Local testing

1. Set up a local enpdoint using localtunnel

    a) Install [localtunnel](http://localtunnel.me/) 
    
    b) Run it using port `4567`

2. Set up a test target and trigger in zendesk

    a) The trigger should require the requester be you (the tester) and include any change. The trigger message should be a json block that includes the id and status. 

    b) The target should be set to the local endpoint you set up in (1).  NB: You wil need to reset this endpoint each time the tunnel session ends

3.  Make your changes to the app, then fire it up and alter your test ticket to see the response. 

4.  View any received messages in the [segment debugger](https://segment.com/aptible/backend-prod/debugger)

Copyright (c) 2015 [Aptible](https://www.aptible.com). All rights reserved.

[<img src="https://s.gravatar.com/avatar/d551a12eca2f98e71c8044c04e9aee1d&s=50" style="border-radius: 50%;" alt="@wcpines" />](https://github.com/wcpines)<commit_msg>adding CLI example and ZD links<commit_after>![Aptible, Inc.](http://aptible-media-assets-manual.s3.amazonaws.com/web-horizontal-350.png)

#Minitron
_________

_Minitron.rb_ is a zendesk-to-segment webhook-based integration.

Each time a ticket status changes to `Closed`, a zendesk trigger hits the sinatra app endpoint with an ID and a status.  The app then uses that ID to query the zendesk api for ticket and ticket_metric data which is forwarded on to segment.

###Local testing

1. Set up a local enpdoint using localtunnel

    a) Install [localtunnel](http://localtunnel.me/) 
    
    b) Run it using port `4567`
      
        lt --port 4567

2. Set up a test target and trigger in zendesk

    a) The [trigger](https://aptible.zendesk.com/agent/admin/triggers) should require the requester be you (the tester) and include any change. The trigger message should be a json block that includes the id and status. 

    b) The [target](https://aptible.zendesk.com/agent/admin/extensions) should be set to the local endpoint you set up in (1).  NB: You wil need to reset this endpoint each time the tunnel session ends

3.  Make your changes to the app, then fire it up and alter your test ticket to see the response. 

4.  View any received messages in the [segment debugger](https://segment.com/aptible/backend-prod/debugger)

Copyright (c) 2015 [Aptible](https://www.aptible.com). All rights reserved.

[<img src="https://s.gravatar.com/avatar/d551a12eca2f98e71c8044c04e9aee1d&s=50" style="border-radius: 50%;" alt="@wcpines" />](https://github.com/wcpines)
{'fraction_non_alphanumeric': 0.09335124244459368, 'fraction_numerical': 0.027535258562793822, 'mean_word_length': 3.965, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2664010', 'n_tokens_mistral': 978, 'n_tokens_neox': 909, 'n_words': 371}