Skip to content

Instantly share code, notes, and snippets.

@aodin aodin/
Created Dec 1, 2014

What would you like to do?
# Description:
# Get the top news item from HN
# Commands:
# hubot hn - Return the top item on HN
module.exports = (robot) ->
robot.respond /hn( me)?$/i, (msg) ->
story = hnTopStory(msg)
console.log story
if story?
msg.send 'Something interesting #{story}'
msg.send 'There is nothing interesting on HN. As usual.'
hnTopStory = (msg) ->
.get() (err, res, body) ->
console.log body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.