wp2hatena 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/wp2hatena_decode +21 -0
- data/lib/wp2hatena/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad46f72056091e04b625687a779bf23596c57f56
|
4
|
+
data.tar.gz: 45c0ccaa958b30a086671644ed5bf3d9515f56ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99621b40c536316eddc37c10ac33350d754f0abed0f6660577d2ebeecb78ffa086bff7a2316f7621d442b81b1a497322740121295c09de489259ad072c2a3df1
|
7
|
+
data.tar.gz: 0f11ee552f4aac84231516e8872bfc6f9e019f0fa3521211f16b0d3e8d7955833310f5b0f0fcd38f42244ee64f3a2df5c89ceaacb787fe8d786aabfed238dbb0
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rexml/document'
|
4
|
+
require 'uri'
|
5
|
+
|
6
|
+
print 'WORDPRESS_XML_PATH:'
|
7
|
+
WORDPRESS_XML_PATH = gets.chomp
|
8
|
+
|
9
|
+
open(WORDPRESS_XML_PATH, 'r') do |fp|
|
10
|
+
buffer = fp.read
|
11
|
+
doc = REXML::Document.new(buffer)
|
12
|
+
REXML::XPath.match(doc, "//wp:post_name").map do |post_name|
|
13
|
+
next if post_name.text.nil?
|
14
|
+
buffer.gsub!(post_name.text, URI.decode(post_name.text))
|
15
|
+
end
|
16
|
+
|
17
|
+
File.write(
|
18
|
+
WORDPRESS_XML_PATH.gsub(/\.xml$/, '.decoded.xml'),
|
19
|
+
buffer
|
20
|
+
)
|
21
|
+
end
|
data/lib/wp2hatena/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wp2hatena
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- utahta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -71,6 +71,7 @@ email:
|
|
71
71
|
- labs.ninxit@gmail.com
|
72
72
|
executables:
|
73
73
|
- wp2hatena
|
74
|
+
- wp2hatena_decode
|
74
75
|
- wp2hatena_oauth
|
75
76
|
extensions: []
|
76
77
|
extra_rdoc_files: []
|
@@ -83,6 +84,7 @@ files:
|
|
83
84
|
- bin/console
|
84
85
|
- bin/setup
|
85
86
|
- exe/wp2hatena
|
87
|
+
- exe/wp2hatena_decode
|
86
88
|
- exe/wp2hatena_oauth
|
87
89
|
- lib/wp2hatena.rb
|
88
90
|
- lib/wp2hatena/hatena/converter.rb
|