qiita_trend 0.2.4 → 0.2.5
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +44 -38
- data/lib/qiita_trend/trend.rb +3 -1
- data/lib/qiita_trend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dcf73f636b9e831bf6c5a0464ac87a3a091c8588d87ea3127c0975f84059c7d
|
4
|
+
data.tar.gz: 81c4a7e45ff90d5e77caff8445f0fad8c03d6b7e89d0ff017504d403ed5d64f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27cb6f33f186007daf238aa5ded65989190c715c7d1469c97313336ab09a98035bb48110c78a9676c8ff640ef1c8be75aacc72c4a4a8fbdfccf7d92b5b48ba0
|
7
|
+
data.tar.gz: '00157805cfc4a652db79838190a67c46af776679551b296d3536727f1afda32a96be31d5c46cae93668dc0acbca712e8d72c6e6fb80a83de64b4ff73de199e1f'
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# QiitaTrend
|
2
2
|
|
3
|
-
|
4
3
|
[](https://badge.fury.io/rb/qiita_trend) [](https://github.com/dodonki1223/qiita_trend/blob/master/LICENSE.txt) [](https://circleci.com/gh/dodonki1223/qiita_trend/tree/master)
|
5
4
|
|
6
5
|
Qiitaのトレンドを10秒で取得することができます
|
@@ -36,7 +35,6 @@ Or install it yourself as:
|
|
36
35
|
### QiitaのDailyのトレンドを10秒で取得する
|
37
36
|
|
38
37
|
ターミナルでコマンド`gem install qiita_trend`、`ruby -r qiita_trend -e "pp QiitaTrend::Trend.new.items"`を実行することでQiitaのトレンドを10秒で取得できます
|
39
|
-
**2019年8月2日08時00分頃に実行した結果です**
|
40
38
|
|
41
39
|
```shell
|
42
40
|
$ gem install qiita_trend
|
@@ -48,20 +46,23 @@ Done installing documentation for qiita_trend after 0 seconds
|
|
48
46
|
1 gem installed
|
49
47
|
|
50
48
|
$ ruby -r qiita_trend -e "pp QiitaTrend::Trend.new.items"
|
51
|
-
[{"title"=>"
|
52
|
-
"user_name"=>"
|
53
|
-
"user_image"=>
|
54
|
-
"https://qiita-image-store.s3.amazonaws.com/0/114709/profile-,images/1473712681",
|
55
|
-
"likes_count"=>130,
|
56
|
-
"is_new_arrival"=>false,
|
57
|
-
"article"=>"https://qiita.com/guitar_char/items/3b31f7cc79333120b452"},
|
58
|
-
{"title"=>"恐竜でもわかるJavaScript",
|
59
|
-
"user_name"=>"baby-degu",
|
49
|
+
[{"title"=>"2行でwebpack.config.jsで補完を効かせる方法",
|
50
|
+
"user_name"=>"akameco",
|
60
51
|
"user_image"=>
|
61
|
-
"https://qiita-image-store.s3.
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
52
|
+
"https://qiita-image-store.s3.amazonaws.com/0/15319/profile-images/1473684249",
|
53
|
+
"user_page"=>"https://qiita.com/akameco",
|
54
|
+
"article"=>"https://qiita.com/akameco/items/e12377e55e379d29636e",
|
55
|
+
"created_at"=>"2019-08-05T01:17:34Z",
|
56
|
+
"likes_count"=>158,
|
57
|
+
"is_new_arrival"=>false},
|
58
|
+
{"title"=>"Excelで誰でも簡単言語処理 (感情推定, 固有表現抽出, キーワード抽出, 文類似度推定 etc...)",
|
59
|
+
"user_name"=>"Harusugi",
|
60
|
+
"user_image"=>"https://avatars2.githubusercontent.com/u/19549989?v=4",
|
61
|
+
"user_page"=>"https://qiita.com/Harusugi",
|
62
|
+
"article"=>"https://qiita.com/Harusugi/items/535874c0456dbc4db231",
|
63
|
+
"created_at"=>"2019-08-04T23:01:22Z",
|
64
|
+
"likes_count"=>103,
|
65
|
+
"is_new_arrival"=>false},
|
65
66
|
...
|
66
67
|
```
|
67
68
|
|
@@ -76,12 +77,12 @@ index + タイトル名 + いいね数 + ユーザー名
|
|
76
77
|
```shell
|
77
78
|
$ ruby -r qiita_trend -e "QiitaTrend::Trend.new.items.each_with_index {|t, i| puts '[' + i.to_s + ']' + t['title'] + '(' + t['likes_count'].to_s + ')' + ' - ' + t['user_name']}"
|
78
79
|
|
79
|
-
[0]
|
80
|
-
[1]
|
81
|
-
[2]
|
82
|
-
[3]
|
83
|
-
[4]
|
84
|
-
[5]
|
80
|
+
[0]2行でwebpack.config.jsで補完を効かせる方法(158) - akameco
|
81
|
+
[1]Excelで誰でも簡単言語処理 (感情推定, 固有表現抽出, キーワード抽出, 文類似度推定 etc...)(103) - Harusugi
|
82
|
+
[2]コミュニケーション能力についてTwitterで打ち明けたら解決の糸口が見つかった話(109) - cyross4vocaloid
|
83
|
+
[3]畑に農作物を植えてみたけど、忙しくて毎日水やりにいけないのに日照り続きでどうしたものかと悩んでいたら、自動で散水する方法を思いついて試してみたという話(86) - mix_dvd
|
84
|
+
[4]KAGGLEでどこから手を付けていいか分からず学ぶことが多すぎてまとめてみた(89) - aokikenichi
|
85
|
+
[5]畳み込みニューラルネットワークは何を見ているか(69) - okn-yu
|
85
86
|
```
|
86
87
|
|
87
88
|
#### Dailyのトレンドのタイトル一覧
|
@@ -89,12 +90,12 @@ $ ruby -r qiita_trend -e "QiitaTrend::Trend.new.items.each_with_index {|t, i| pu
|
|
89
90
|
```shell
|
90
91
|
$ ruby -r qiita_trend -e "QiitaTrend::Trend.new.items.each {|t| puts t['title']}"
|
91
92
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
2行でwebpack.config.jsで補完を効かせる方法
|
94
|
+
Excelで誰でも簡単言語処理 (感情推定, 固有表現抽出, キーワード抽出, 文類似度推定 etc...)
|
95
|
+
コミュニケーション能力についてTwitterで打ち明けたら解決の糸口が見つかった話
|
96
|
+
畑に農作物を植えてみたけど、忙しくて毎日水やりにいけないのに日照り続きでどうしたものかと悩んでいたら、自動で散水する方法を思いついて試してみたという話
|
97
|
+
KAGGLEでどこから手を付けていいか分からず学ぶことが多すぎてまとめてみた
|
98
|
+
畳み込みニューラルネットワークは何を見ているか
|
98
99
|
```
|
99
100
|
|
100
101
|
#### Dailyのトレンドのうち`new`がついているものをブラウザで一括で開く
|
@@ -125,7 +126,7 @@ p daily_trend.items
|
|
125
126
|
p daily_trend.new_items
|
126
127
|
```
|
127
128
|
|
128
|
-
|
129
|
+
### Weekly、Monthlyのトレンドを取得する
|
129
130
|
|
130
131
|
WeeklyとMonthlyのトレンドを取得する時はQiitaにログインしている必要があるため、ログイン出来るユーザーとパスワードの設定が必要です
|
131
132
|
|
@@ -147,7 +148,7 @@ p monthly_trend.items
|
|
147
148
|
p monthly_trend.new_items
|
148
149
|
```
|
149
150
|
|
150
|
-
|
151
|
+
### itemsメソッド、new_itemsメソッドについて
|
151
152
|
|
152
153
|
itemsメソッド、new_itemsメソッドは`Array`を返します
|
153
154
|
Array一つ一つは`Hash`になります
|
@@ -162,25 +163,30 @@ irb(main):003:0> QiitaTrend::Trend.new.items[0].class
|
|
162
163
|
Hashは以下の構成になっています
|
163
164
|
|
164
165
|
```shell
|
165
|
-
irb(main):
|
166
|
-
{"title"=>"
|
167
|
-
"user_name"=>"
|
166
|
+
irb(main):001:0> pp QiitaTrend::Trend.new.items[0]
|
167
|
+
{"title"=>"2行でwebpack.config.jsで補完を効かせる方法",
|
168
|
+
"user_name"=>"akameco",
|
168
169
|
"user_image"=>
|
169
|
-
"https://qiita-image-store.s3.amazonaws.com/0/
|
170
|
-
"
|
171
|
-
"
|
172
|
-
"
|
170
|
+
"https://qiita-image-store.s3.amazonaws.com/0/15319/profile-images/1473684249",
|
171
|
+
"user_page"=>"https://qiita.com/akameco",
|
172
|
+
"article"=>"https://qiita.com/akameco/items/e12377e55e379d29636e",
|
173
|
+
"created_at"=>"2019-08-05T01:17:34Z",
|
174
|
+
"likes_count"=>158,
|
175
|
+
"is_new_arrival"=>false}
|
173
176
|
```
|
174
177
|
|
175
178
|
| key | 内容 | 備考 |
|
176
179
|
|:--------------:|:-------------------------:|:---------------------:|
|
180
|
+
| title | 記事タイトル | |
|
177
181
|
| user_name | ユーザー名 | |
|
178
182
|
| user_image | ユーザー画像URL | |
|
183
|
+
| user_page | ユーザーページ | |
|
184
|
+
| article | 記事のURL | |
|
185
|
+
| created_at | 記事作成日 | |
|
179
186
|
| likes_count | いいね数 | 数値が入ります |
|
180
187
|
| is_new_arrival | 「NEW」のついている記事か | TrueかFalseが入ります |
|
181
|
-
| article | 記事のURL | |
|
182
188
|
|
183
|
-
|
189
|
+
### キャシュファイルの出力先を変更する
|
184
190
|
|
185
191
|
キャッシュファイルはデフォルトだと`ユーザーのHOMEディレクトリ/qiita_cache/`に出力されます
|
186
192
|
|
data/lib/qiita_trend/trend.rb
CHANGED
@@ -22,9 +22,11 @@ module QiitaTrend
|
|
22
22
|
result['title'] = trend['node']['title']
|
23
23
|
result['user_name'] = trend['node']['author']['urlName']
|
24
24
|
result['user_image'] = trend['node']['author']['profileImageUrl']
|
25
|
+
result['user_page'] = "#{Page::QIITA_URI}#{trend['node']['author']['urlName']}"
|
26
|
+
result['article'] = "#{Page::QIITA_URI}#{trend['node']['author']['urlName']}/items/#{trend['node']['uuid']}"
|
27
|
+
result['created_at'] = trend['node']['createdAt']
|
25
28
|
result['likes_count'] = trend['node']['likesCount']
|
26
29
|
result['is_new_arrival'] = trend['isNewArrival']
|
27
|
-
result['article'] = "#{Page::QIITA_URI}#{trend['node']['author']['urlName']}/items/#{trend['node']['uuid']}"
|
28
30
|
value << result
|
29
31
|
end
|
30
32
|
end
|
data/lib/qiita_trend/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiita_trend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dodonki1223
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|