nogizaka_blog 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbe76780e0a1b57facd3805cd814a8a91d1d56b5
4
- data.tar.gz: f8049d999e5e9db88f72c152d65c43017fae4f96
3
+ metadata.gz: 6c2dd63d32d5b6a051b7b189d5d6c764d74b6971
4
+ data.tar.gz: 1546a7fdd62daa8f010d277e5a72f4bc3d3ab3ed
5
5
  SHA512:
6
- metadata.gz: 216c2cb2dfaca1d741143c411721f4d7c19ec7a0cf9b22c1d2749a69d8b325569eee4b5775dd8cab236cf1588422650e2e993f51cf63946aa0c7f1165fbb68d2
7
- data.tar.gz: d61b73c17698cfdc3cb748db91c10475547bc0830f511b09a4178ec5085f4022131a571016253feccf537089b68ba629ef79b5c9197edd113930074b95db53c6
6
+ metadata.gz: 88c4ef7623cfb2dfaf6f4aa086d748bf8bac9ae3f5f47583a147b04497288e3893af59e607bd89fea71edf8fba828bfa2dde1d0296b0d582436732d8b19698e5
7
+ data.tar.gz: 1328dbbcf6e3203a2822da342559984ee0734799bfe410a744cf5887541225f7e6187745d813664d03a5daf6bd7d2640333c05e3d65fd9d59be1cdcfda1768f9
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # NogizakaBlog
2
2
 
3
+ [![Build Status](https://travis-ci.org/hachy/nogizaka_blog.svg?branch=master)](https://travis-ci.org/hachy/nogizaka_blog)
4
+
3
5
  Get the number of comments and articles per month from Nogizaka46's blog
4
6
 
5
7
  ## Installation
@@ -64,9 +66,11 @@ Basic usage in Terminal
64
66
 
65
67
  $ nogizaka_blog when 201509
66
68
 
69
+ ![screenshots](https://dl.dropboxusercontent.com/u/60760023/screenshots/nogizaka_blog.gif)
70
+
67
71
  ## Contributing
68
72
 
69
- 1. Fork it ( https://github.com/[my-github-username]/nogizaka_blog/fork )
73
+ 1. Fork it ( https://github.com/hachy/nogizaka_blog/fork )
70
74
  2. Create your feature branch (`git checkout -b my-new-feature`)
71
75
  3. Commit your changes (`git commit -am 'Add some feature'`)
72
76
  4. Push to the branch (`git push origin my-new-feature`)
@@ -21,8 +21,8 @@ module NogizakaBlog
21
21
  end
22
22
 
23
23
  def each
24
- max_page
25
- @member_max.each do |name, max|
24
+ MEMBER.keys.each do |name|
25
+ max = max_page(name)
26
26
  @comment = []
27
27
 
28
28
  # @comment = 0 when redirected
@@ -50,33 +50,30 @@ module NogizakaBlog
50
50
 
51
51
  private
52
52
 
53
- def max_page
53
+ def max_page(name)
54
54
  nbsp = Nokogiri::HTML(' ').text
55
- @member_max = []
56
55
 
57
- MEMBER.keys.each do |name|
58
- url = "http://blog.nogizaka46.com/#{name}/?d=#{@yearmonth}"
59
- response = Net::HTTP.get_response(URI.parse(url))
56
+ url = "http://blog.nogizaka46.com/#{name}/?d=#{@yearmonth}"
57
+ response = Net::HTTP.get_response(URI.parse(url))
60
58
 
61
- # Be redirected if it doesn't exist @yearmonth.
62
- case response
63
- when Net::HTTPSuccess
64
- doc = Nokogiri::HTML(open(url))
65
- paginate_class = doc.css('.paginate:first a:nth-last-child(2)')
66
- if paginate_class.empty?
67
- num = 0
68
- else
69
- paginate_class.each do |link|
70
- num = link.content
71
- end
72
- num.gsub!(nbsp, '')
59
+ # Be redirected if it doesn't exist @yearmonth.
60
+ case response
61
+ when Net::HTTPSuccess
62
+ doc = Nokogiri::HTML(open(url))
63
+ paginate_class = doc.css('.paginate:first a:nth-last-child(2)')
64
+ if paginate_class.empty?
65
+ num = 0
66
+ else
67
+ paginate_class.each do |link|
68
+ num = link.content
73
69
  end
74
- when Net::HTTPRedirection
75
- num = -1
70
+ num.gsub!(nbsp, '')
76
71
  end
77
-
78
- @member_max << [name, num.to_i]
72
+ when Net::HTTPRedirection
73
+ num = -1
79
74
  end
75
+
76
+ num.to_i
80
77
  end
81
78
 
82
79
  def comment_size(url)
@@ -1,3 +1,3 @@
1
1
  module NogizakaBlog
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nogizaka_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - hachy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-25 00:00:00.000000000 Z
11
+ date: 2015-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.4.5.1
127
+ rubygems_version: 2.5.0
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Get the number of comments and articles per month from Nogizaka46's blog