pixiv 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/pixiv/member.rb CHANGED
@@ -11,13 +11,13 @@ module Pixiv
11
11
  end
12
12
 
13
13
  # @return [String]
14
- lazy_attr_reader(:name) { at!('.profile_area h2').inner_text }
15
- # @return [Integer]
16
- lazy_attr_reader(:member_id) { at!('input[name="user_id"]')['value'].to_i }
14
+ lazy_attr_reader(:name) { at!('.profile-unit h1').inner_text }
17
15
  # @return [Integer]
16
+ lazy_attr_reader(:member_id) { at!('link[hreflang=en]')['href'][%r{/users/(\d+)}, 1].to_i }
17
+ # @return [String]
18
18
  lazy_attr_reader(:pixiv_id) { profile_image_url[%r{/profile/([a-z_-]+)/}, 1] }
19
19
  # @return [String]
20
- lazy_attr_reader(:profile_image_url) { at!('.profile_area img')['src'] }
20
+ lazy_attr_reader(:profile_image_url) { at!('.profile-unit .user-image')['src'] }
21
21
 
22
22
 
23
23
  alias id member_id
@@ -20,11 +20,11 @@ module Pixiv
20
20
 
21
21
  # @return [Integer]
22
22
  lazy_attr_reader(:page) {
23
- at!('li.pages-current').inner_text.to_i
23
+ at!('ul.page-list .current').inner_text.to_i
24
24
  }
25
25
  # @return [Boolean]
26
26
  lazy_attr_reader(:last?) {
27
- at!('li.pages-current').next_element.inner_text.to_i == 0
27
+ at!('ul.page-list .current').next_element.nil?
28
28
  }
29
29
  # @return [Integer]
30
30
  lazy_attr_reader(:member_id) {
data/lib/pixiv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pixiv
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -2,14 +2,15 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
+ <link rel="alternate" hreflang="en" href="http://www.pixiv.com/users/6" />
5
6
  <title>Member #6</title>
6
7
  </head>
7
8
  <body>
8
- <div class="profile_area">
9
- <!-- name = "Sayoko" -->
10
- <h2>Sayoko</h2>
9
+ <div class="_unit profile-unit">
11
10
  <!-- pixiv_id = "sayoko" -->
12
- <img src="http://i1.pixiv.net/img1/profile/sayoko/123456.jpg">
11
+ <img src="http://i1.pixiv.net/img1/profile/sayoko/123456.png" class="user-image"/>
12
+ <!-- name = "Sayoko" -->
13
+ <h1 class="user">Sayoko</h1>
13
14
  </div>
14
15
  <!-- member_id = 6 -->
15
16
  <form action="/bookmark_add.php" method="post">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixiv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 1.8.24
133
+ rubygems_version: 1.8.23
134
134
  signing_key:
135
135
  specification_version: 3
136
136
  summary: A client library for pixiv