Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:9805909
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
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.