web_stat 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/fetch_as_html +6 -0
- data/lib/web_stat/fetch.rb +3 -3
- data/lib/web_stat/version.rb +1 -1
- data/spec/web_stat/fetch_spec.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d09f9fede0272da84e8174294f32872a95a39059e9af66002bcb54761110cf9
|
4
|
+
data.tar.gz: 2156038d5b220e2d9b5175a03bb8ff9030c779408a5b94982e449a37fca60c12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e2770f42e1763e625001042212ef50afaa5ead1473763fe51b9edc0ecceee4df365457531ac43cc81cbd60b77a20e8109882feba35e425d79799c9cc505375
|
7
|
+
data.tar.gz: 5960afd25f49e1fcea5b66c8fe45aadbb8740e3b77a97fba3f32a3e855e42224310224f86936d32df6da05210184dedeb49989c562c87ad1fbc728d7a183a5e7
|
data/Gemfile.lock
CHANGED
data/bin/fetch_as_html
ADDED
data/lib/web_stat/fetch.rb
CHANGED
@@ -72,13 +72,13 @@ module WebStat
|
|
72
72
|
|
73
73
|
# Get the informations of @url
|
74
74
|
def stat
|
75
|
-
content.gsub
|
75
|
+
clean_content = content.scrub('').gsub(/[\s ]/, "")
|
76
76
|
tag = WebStat::Tag.new(content, userdic: WebStat::Configure.get["userdic"])
|
77
77
|
{
|
78
78
|
title: title,
|
79
79
|
site_name: site_name,
|
80
|
-
content:
|
81
|
-
language_code: CLD.detect_language(
|
80
|
+
content: clean_content,
|
81
|
+
language_code: CLD.detect_language(clean_content)[:code],
|
82
82
|
url: @url,
|
83
83
|
eyecatch_image_path: save_local_path(eyecatch_image_path),
|
84
84
|
tags: tag.nouns
|
data/lib/web_stat/version.rb
CHANGED
data/spec/web_stat/fetch_spec.rb
CHANGED
@@ -97,8 +97,8 @@ RSpec.describe WebStat::Fetch do
|
|
97
97
|
|
98
98
|
it "valid url" do
|
99
99
|
web_stat_fetch_web_class = WebStat::FetchAsWeb.new("https://newsdict.blog/content/images/size/w100/2019/03/facebook-3.jpg")
|
100
|
-
|
101
|
-
|
100
|
+
expect(web_stat_fetch_web_class.url_valid?("http://status.aws.amazon.com/#cloudfront_12345")).to be true
|
101
|
+
expect(web_stat_fetch_web_class.url_valid?("https://findy-code.io?h=NWsZey5UgJ51u&t=omikuji-22")).to be true
|
102
102
|
expect(web_stat_fetch_web_class.url_valid?("https://www.meetup.com/pro/docker")).to be true
|
103
103
|
expect(web_stat_fetch_web_class.url_valid?("https://gxyt4.app.goo.gl/Mn64U")).to be true
|
104
104
|
expect(web_stat_fetch_web_class.url_valid?("https://status.cloud.google.com/incident/cloud-functions/19010")).to be true
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_stat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yusuke abe
|
@@ -181,7 +181,8 @@ dependencies:
|
|
181
181
|
description: Fetch the web pages and stat.
|
182
182
|
email:
|
183
183
|
- yube@newsdict.jp
|
184
|
-
executables:
|
184
|
+
executables:
|
185
|
+
- fetch_as_html
|
185
186
|
extensions: []
|
186
187
|
extra_rdoc_files: []
|
187
188
|
files:
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- LICENSE.txt
|
196
197
|
- README.md
|
197
198
|
- Rakefile
|
199
|
+
- bin/fetch_as_html
|
198
200
|
- lib/web_stat.rb
|
199
201
|
- lib/web_stat/categorize.rb
|
200
202
|
- lib/web_stat/config/web_stat.yml
|