Class: Member
- Inherits:
-
Object
- Object
- Member
- Defined in:
- lib/bilibili.rb
Instance Attribute Summary collapse
-
#approve ⇒ Object
是否为认证用户.
-
#article ⇒ Object
理解不能.
-
#attention ⇒ Object
TA关注的人数.
-
#attentions ⇒ Object
TA关注的人.
-
#birthday ⇒ Object
生日.
-
#coins ⇒ Object
硬币数.
-
#current_exp ⇒ Object
TA的经验.
-
#current_level ⇒ Object
当前级别.
-
#current_min ⇒ Object
当前级别起始经验.
-
#description ⇒ Object
描述.
-
#displayRank ⇒ Object
显示排名.
-
#face ⇒ Object
头像URL.
-
#fansCount ⇒ Object
关注TA的人数.
-
#friend ⇒ Object
TA关注的人数.
-
#mid ⇒ Object
用户id.
-
#name ⇒ Object
昵称.
-
#next_exp ⇒ Object
到达下一级需要的经验.
-
#place ⇒ Object
地点.
-
#rank ⇒ Object
排名.
-
#regtime ⇒ Object
注册时间.
-
#sex ⇒ Object
性别.
-
#sign ⇒ Object
签名.
-
#spacesta ⇒ Object
理解不能.
Class Method Summary collapse
Instance Method Summary collapse
-
#attentionList ⇒ Object
关注列表.
-
#coinVideos ⇒ Object
投过币的视频.
-
#collectionList ⇒ Object
我的收藏.
-
#fans ⇒ Object
粉丝.
-
#submitVideos(tid = 0) ⇒ Object
投稿视频.
-
#subscribeList ⇒ Object
订阅番剧.
-
#subscribeTags ⇒ Object
订阅标签.
Instance Attribute Details
#approve ⇒ Object
是否为认证用户
33 34 35 |
# File 'lib/bilibili.rb', line 33 def approve @approve end |
#article ⇒ Object
理解不能
44 45 46 |
# File 'lib/bilibili.rb', line 44 def article @article end |
#attention ⇒ Object
TA关注的人数
48 49 50 |
# File 'lib/bilibili.rb', line 48 def attention @attention end |
#attentions ⇒ Object
TA关注的人
45 46 47 |
# File 'lib/bilibili.rb', line 45 def attentions @attentions end |
#birthday ⇒ Object
生日
41 42 43 |
# File 'lib/bilibili.rb', line 41 def birthday @birthday end |
#coins ⇒ Object
硬币数
37 38 39 |
# File 'lib/bilibili.rb', line 37 def coins @coins end |
#current_exp ⇒ Object
TA的经验
52 53 54 |
# File 'lib/bilibili.rb', line 52 def current_exp @current_exp end |
#current_level ⇒ Object
当前级别
50 51 52 |
# File 'lib/bilibili.rb', line 50 def current_level @current_level end |
#current_min ⇒ Object
当前级别起始经验
51 52 53 |
# File 'lib/bilibili.rb', line 51 def current_min @current_min end |
#description ⇒ Object
描述
43 44 45 |
# File 'lib/bilibili.rb', line 43 def description @description end |
#displayRank ⇒ Object
显示排名
38 39 40 |
# File 'lib/bilibili.rb', line 38 def displayRank @displayRank end |
#face ⇒ Object
头像URL
36 37 38 |
# File 'lib/bilibili.rb', line 36 def face @face end |
#fansCount ⇒ Object
关注TA的人数
46 47 48 |
# File 'lib/bilibili.rb', line 46 def fansCount @fansCount end |
#friend ⇒ Object
TA关注的人数
47 48 49 |
# File 'lib/bilibili.rb', line 47 def friend @friend end |
#mid ⇒ Object
用户id
31 32 33 |
# File 'lib/bilibili.rb', line 31 def mid @mid end |
#name ⇒ Object
昵称
32 33 34 |
# File 'lib/bilibili.rb', line 32 def name @name end |
#next_exp ⇒ Object
到达下一级需要的经验
53 54 55 |
# File 'lib/bilibili.rb', line 53 def next_exp @next_exp end |
#place ⇒ Object
地点
42 43 44 |
# File 'lib/bilibili.rb', line 42 def place @place end |
#rank ⇒ Object
排名
35 36 37 |
# File 'lib/bilibili.rb', line 35 def rank @rank end |
#regtime ⇒ Object
注册时间
39 40 41 |
# File 'lib/bilibili.rb', line 39 def regtime @regtime end |
#sex ⇒ Object
性别
34 35 36 |
# File 'lib/bilibili.rb', line 34 def sex @sex end |
#sign ⇒ Object
签名
49 50 51 |
# File 'lib/bilibili.rb', line 49 def sign @sign end |
#spacesta ⇒ Object
理解不能
40 41 42 |
# File 'lib/bilibili.rb', line 40 def spacesta @spacesta end |
Class Method Details
.member_with_JSON(json) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/bilibili.rb', line 55 def Member.member_with_JSON(json) data = json['data'] user = Member.new user.mid = data['mid'] user.name = data['name'] user.approve = data['approve'] user.sex = data['sex'] user.rank = data['rank'] user.face = data['face'] user.coins = data['coins'] user.displayRank = data['displayRank'] user.regtime = data['regtime'] user.spacesta = data['spacesta'] user.birthday = data['birthday'] user.place = data['place'] user.description = data['description'] user.article = data['article'] user.attentions = data['attentions'] user.fansCount = data['fans'] user.friend = data['friend'] user.attention = data['attention'] user.sign = data['sign'] user.current_level = data['level_info']['current_level'] user.current_min = data['level_info']['current_min'] user.current_exp = data['level_info']['current_exp'] user.next_exp = data['level_info']['next_exp'] user end |
Instance Method Details
#attentionList ⇒ Object
关注列表
115 116 117 118 |
# File 'lib/bilibili.rb', line 115 def attentionList response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_ATTENTION_LIST + @mid) JSON.parse(response.body) end |
#coinVideos ⇒ Object
投过币的视频
109 110 111 112 |
# File 'lib/bilibili.rb', line 109 def coinVideos response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_COINVIDEO_QUERY + @mid) JSON.parse(response.body) end |
#collectionList ⇒ Object
我的收藏
91 92 93 94 |
# File 'lib/bilibili.rb', line 91 def collectionList response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_BOX_LIST + @mid) JSON.parse(response.body) end |
#fans ⇒ Object
粉丝
121 122 123 124 |
# File 'lib/bilibili.rb', line 121 def fans response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_FANS_QUERY + @mid) JSON.parse(response.body) end |
#submitVideos(tid = 0) ⇒ Object
投稿视频
85 86 87 88 |
# File 'lib/bilibili.rb', line 85 def submitVideos(tid = 0) response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_SUBMITVIDEOS + @mid + "&tid=" + tid.to_s) JSON.parse(response.body) end |
#subscribeList ⇒ Object
订阅番剧
97 98 99 100 |
# File 'lib/bilibili.rb', line 97 def subscribeList response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_SUBSCRIBE_QUERY + @mid) JSON.parse(response.body) end |
#subscribeTags ⇒ Object
订阅标签
103 104 105 106 |
# File 'lib/bilibili.rb', line 103 def subscribeTags response = Net::HTTP.new(K_BILIBILI_API_SPACE_URL).get(K_BILIBILI_API_SPACE_SUBSCRIBE_TAGS_QUERY + @mid) JSON.parse(response.body) end |