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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90030fe0082c3bd528c2a2dcec6d6539df7a42ca024c9710e110d42af56d0d49
4
- data.tar.gz: 7ad6b5178e4892229623a5f5d89368ec4dd1e899ef501422bc3b3ff38c207154
3
+ metadata.gz: 7d09f9fede0272da84e8174294f32872a95a39059e9af66002bcb54761110cf9
4
+ data.tar.gz: 2156038d5b220e2d9b5175a03bb8ff9030c779408a5b94982e449a37fca60c12
5
5
  SHA512:
6
- metadata.gz: 5d2c7ac403071588b6f1e5e1afb62f7032c55736a23057d7bb4e2147d15935224f51b2ad74dc987c8f5e84166a2baae6565f207c32f3b3cdb88147183b29fcb0
7
- data.tar.gz: d4774d7f3bb27c06c893d90fb1be43a52e3f0d9ed528854e3dadcdf49e122263abcfbca4a872ee30375c3a931de7b29678aa59b9a1656c9ccdd5ea9a803f2b09
6
+ metadata.gz: 31e2770f42e1763e625001042212ef50afaa5ead1473763fe51b9edc0ecceee4df365457531ac43cc81cbd60b77a20e8109882feba35e425d79799c9cc505375
7
+ data.tar.gz: 5960afd25f49e1fcea5b66c8fe45aadbb8740e3b77a97fba3f32a3e855e42224310224f86936d32df6da05210184dedeb49989c562c87ad1fbc728d7a183a5e7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- web_stat (0.2.3)
4
+ web_stat (0.2.4)
5
5
  bundler (>= 2.0.2)
6
6
  cld (>= 0.8.0)
7
7
  final_redirect_url (>= 0.1.0)
data/bin/fetch_as_html ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../', __dir__)
3
+ require "bundler/setup"
4
+ require "#{APP_PATH}/lib/web_stat.rb"
5
+ p "[ERROR] Not enough argments. example) fetch_as_html https://newsdict.jp" if ARGV[0].nil?
6
+ p WebStat.stat_by_url(ARGV[0])
@@ -72,13 +72,13 @@ module WebStat
72
72
 
73
73
  # Get the informations of @url
74
74
  def stat
75
- content.gsub!(/(\n|\t|\s| )/, "")
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: content,
81
- language_code: CLD.detect_language(content)[:code],
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
@@ -1,3 +1,3 @@
1
1
  module WebStat
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -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
- #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
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.3
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