Git Product home page Git Product logo

hubot-pugme's Introduction

hubot-pugme

Pugme is the most important hubot script

See src/pugme.coffee for full documentation.

Installation

In hubot project repo, run:

npm install hubot-pugme --save

Then add hubot-pugme to your external-scripts.json:

[
  "hubot-pugme"
]

Sample Interaction

user1>> hubot pug me
hubot>> http://30.media.tumblr.com/tumblr_lj50gs8rAX1qaa50yo1_500.jpg
user1>> hubot pug bomb me
hubot>> http://30.media.tumblr.com/tumblr_lj50gs8rAX1qaa50yo1_500.jpg
hubot>> http://24.media.tumblr.com/95a84579fa297844891b3ab1a5c76c0a/tumblr_mooibbcKl51rylzllo1_500.jpg
hubot>> http://27.media.tumblr.com/tumblr_ll5akuIrji1qk3h3co1_500.png
hubot>> http://29.media.tumblr.com/tumblr_ll3xcmS6Bh1qb08qmo1_500.jpg

hubot-pugme's People

Contributors

gr2m avatar technicalpickles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hubot-pugme's Issues

Add checks of HTTP response code

The pugme service is currently down, which causes the pug commands to be ignored from user's point of view.

In reality an error is raised:

[Thu Jun 09 2016 18:36:55 GMT+0000 (UTC)] ERROR SyntaxError: Unexpected token <
 at Object.parse (native)
 at /workdir/node_modules/hubot-pugme/src/pugme.coffee:19:9, <js>:5:30
 at IncomingMessage.<anonymous> (/workdir/node_modules/scoped-http-client/src/index.js:95:22)
 at emitNone (events.js:72:20)
 at IncomingMessage.emit (events.js:166:7)
 at endReadableNT (_stream_readable.js:905:12)
 at doNTCallback2 (node.js:452:9)
 at process._tickDomainCallback (node.js:407:17)

I believe there can be some simple http response code checks (probably code != 200) in place to make hubot return a reasonably nice error message to the user.

pugme occasionally crashes hubot

love pugme.
some instances when running a command such as hubot pug me 12 etc it crashes hubot.

checking out the source it pulls from the pugme service. Trying to debug why it crashes. I noticed some of the results parsed from pugme have extra html tags in the results. Those results appear infrequently but when a larger number of pugs is requested, more likelylihood of a bad url is returned.

This led me to believe it might be from pugme why the bots crashing but its just a hunch.

http://pugme.herokuapp.com/bomb?count=1000

screenshot 2015-02-12 21 10 01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.