Last active
December 9, 2015 22:58
-
-
Save donpdonp/4340582 to your computer and use it in GitHub Desktop.
neuronbot coderwall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(msg) { | |
var cmd = /^coderwall\s+(\S+)/ | |
var match = cmd.exec(msg.message) | |
if(match) { | |
var username = match[1] | |
var profile = JSON.parse(http.get("https://coderwall.com/"+username+".json")) | |
var badge_list = profile.badges.map(function(b){return b.name}) | |
return badge_list.join(', ') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment