hateblo-mixed-contents-finder 0.1.0 → 0.1.1
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/.travis.yml +7 -0
- data/README.md +10 -44
- data/exe/hateblo_mixed_contents_finder +1 -1
- data/lib/hateblo_mixed_contents_finder/cli.rb +3 -2
- data/lib/hateblo_mixed_contents_finder/hatena_client.rb +3 -2
- data/lib/hateblo_mixed_contents_finder/version.rb +1 -1
- metadata +2 -2
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de7cb6c638627ed4aa6d150d8959459915cc26c0f126d05ff686de3848729952
|
4
|
+
data.tar.gz: 3e96ceab36648143c8bfa4618f88eb55be0e8ecc160dc8f84c260420599f5acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7408af609c6ccf6acbbac16b4f5d46e9f382e620e45b5023db7faefe4209f0766fbdc7a3a6beddb6e420af5966677e53996b3e098428121d2620258d1c8b9a99
|
7
|
+
data.tar.gz: 37b836016fd8387a9112c06e84d740b42c6d2a784847ac3407c698d46d3eb3496846a27ecac97ec07d7e891e93aa8b8e1f4da2bea8ab729da29817852be9afed
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,48 +1,8 @@
|
|
1
1
|
# hateblo-mixed-contents-finder
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'hateblo-mixed-contents-finder'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install hateblo-mixed-contents-finder
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
Describe later in Japanese.
|
24
|
-
|
25
|
-
## Development
|
26
|
-
|
27
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
-
|
29
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
3
|
+
[](https://badge.fury.io/rb/hateblo-mixed-contents-finder) [](https://travis-ci.org/JunichiIto/hateblo-mixed-contents-finder)
|
30
4
|
|
31
|
-
|
32
|
-
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/JunichiIto/hateblo-mixed-contents-finder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
34
|
-
|
35
|
-
## License
|
36
|
-
|
37
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
38
|
-
|
39
|
-
## Code of Conduct
|
40
|
-
|
41
|
-
Everyone interacting in the Dev::Gem::Sandbox project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/JunichiIto/hateblo-mixed-contents-finder/blob/master/CODE_OF_CONDUCT.md).
|
42
|
-
|
43
|
-
----
|
44
|
-
|
45
|
-
# hateblo-mixed-contents-finder
|
5
|
+
Helper scripts for Hatena blog HTTPS migration
|
46
6
|
|
47
7
|
はてなブログをHTTP配信からHTTPS配信に移行する際に利用すると便利なヘルパースクリプト集です。
|
48
8
|
|
@@ -54,12 +14,18 @@ Everyone interacting in the Dev::Gem::Sandbox project’s codebases, issue track
|
|
54
14
|
|
55
15
|
## 動作環境
|
56
16
|
|
57
|
-
Ruby 2.
|
17
|
+
Ruby 2.3以上 + Mac環境で動作確認しています。
|
58
18
|
|
59
|
-
Ruby 2.
|
19
|
+
Ruby 2.2以下や、Windows環境で正常に動くかどうかは未検証です。
|
60
20
|
|
61
21
|
## セットアップ
|
62
22
|
|
23
|
+
以下のコマンドを使ってgemをインストールします。
|
24
|
+
|
25
|
+
```
|
26
|
+
gem install hateblo-mixed-contents-finder
|
27
|
+
```
|
28
|
+
|
63
29
|
過去記事の更新を実行する場合は`config.yml`の設定が必要になります。以下のページを参照して、自分のOAuthクレデンシャルを`config.yml`に設定してください。
|
64
30
|
|
65
31
|
https://github.com/kymmt90/hatenablog/blob/master/README.md
|
@@ -31,6 +31,7 @@ module HatebloMixedContentsFinder
|
|
31
31
|
if invalid_contents.empty?
|
32
32
|
puts 'OK💚'
|
33
33
|
else
|
34
|
+
puts
|
34
35
|
puts invalid_contents
|
35
36
|
end
|
36
37
|
end
|
@@ -49,8 +50,8 @@ module HatebloMixedContentsFinder
|
|
49
50
|
return unless res == 'yes'
|
50
51
|
|
51
52
|
client = HatenaClient.new
|
52
|
-
File.foreach(path
|
53
|
-
client.update_entry(url)
|
53
|
+
File.foreach(path) do |url|
|
54
|
+
client.update_entry(url.chomp)
|
54
55
|
sleep sleep_sec
|
55
56
|
end
|
56
57
|
puts 'Completed.'
|
@@ -3,9 +3,10 @@ require 'hatenablog'
|
|
3
3
|
|
4
4
|
module HatebloMixedContentsFinder
|
5
5
|
class HatenaClient
|
6
|
-
def update_entry(entry_url)
|
6
|
+
def update_entry(entry_url, config_file: nil)
|
7
7
|
entry_id = fetch_id(entry_url)
|
8
|
-
|
8
|
+
params = config_file ? [config_file] : []
|
9
|
+
Hatenablog::Client.create(*params) do |blog_client|
|
9
10
|
posted_entry = blog_client.get_entry(entry_id)
|
10
11
|
puts "[#{Time.now.strftime("%H:%M:%S")}] Updating #{entry_url} #{posted_entry.title}"
|
11
12
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hateblo-mixed-contents-finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Junichi Ito
|
@@ -132,7 +132,7 @@ extra_rdoc_files: []
|
|
132
132
|
files:
|
133
133
|
- ".gitignore"
|
134
134
|
- ".rspec"
|
135
|
-
- ".
|
135
|
+
- ".travis.yml"
|
136
136
|
- CODE_OF_CONDUCT.md
|
137
137
|
- Gemfile
|
138
138
|
- Gemfile.lock
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.5.1
|