Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@bloot /gist:9805909
Last active

require 'redditkit'
def action(answer)
puts "Username?"
@redditor = gets.chomp
@user = RedditKit.user @redditor if (answer == 1 || answer == 2)
end
def standby
puts %q( What would you like to do?
See someones link karma? - 1
See someones Comment Karma - 2
See someones Comments? - 3
Check to see if a username is avaliable? - 4)
answer = gets.chomp.to_i
case answer
when 1
action(answer)
puts "User #{@user.username} has #{@user.link_karma} link karma!"
when 2
action(answer)
puts "User #{@user.username} has #{@user.comment_karma} link karma!"
when 3
action(answer)
user = RedditKit.user_content @redditor, options = {category: 'comments' }
user.each{|x| puts "\n#{x.body}\n-#{x.author}\n"}
when 4
action(answer)
client = RedditKit.username_available? @redditor
client ? result = "Username is avaliable!" : result = "Username Taken :("
puts result
else
puts "You entered unexpected input. Please try again"
exit
end
end
standby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.