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 +4 -4
- data/README.md +5 -1
- data/lib/nogizaka_blog/amazing.rb +20 -23
- data/lib/nogizaka_blog/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c2dd63d32d5b6a051b7b189d5d6c764d74b6971
|
4
|
+
data.tar.gz: 1546a7fdd62daa8f010d277e5a72f4bc3d3ab3ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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
|
-
|
25
|
-
|
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
|
-
|
58
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
|
75
|
-
num = -1
|
70
|
+
num.gsub!(nbsp, '')
|
76
71
|
end
|
77
|
-
|
78
|
-
|
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)
|
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.
|
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-
|
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.
|
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
|