Skip to content
Browse files

Added logic to get username/id to init

  • Loading branch information...
1 parent a505458 commit f1d2905768dbfc0ff2d4cf5caa9f484ad23298af @paradox460 committed Aug 5, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/snoo.rb
View
6 lib/snoo.rb
@@ -36,6 +36,12 @@ def initialize opts={}
self.class.headers @headers
set_cookies = opts[:cookies] || nil
@modhash = opts[:modhash] || nil
+
+ if @cookies and @modhash
+ myinfo = get("/api/me.json")
+ @username = myinfo['data']['name']
+ @userid = 't2_' + myinfo['data']['id']
+ end
end
end
end

0 comments on commit f1d2905

Please sign in to comment.
Something went wrong with that request. Please try again.