wp2tumblr 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -16
- data/bin/wp2tumblr +6 -0
- data/lib/server/config.ru +3 -0
- data/lib/server/sinatra_server.rb +5 -0
- data/lib/wp2tumblr/version.rb +1 -1
- data/wp2tumblr.gemspec +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b4b19027d615019e3b447a34005f0e265479f6d
|
4
|
+
data.tar.gz: 24b148146d1591997d7d0afe6bff14ba003b9fab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a26638e5161ef6a05c76c78e3cc37353996bc93402bd4f7f724d3b7bc9fd4c4243b38e35ae3af49e0a749f242bcdfc115dcaed00f07fd17dcf62fdb823532f9
|
7
|
+
data.tar.gz: 80d857c15f2665fc3c4e013ec41174ede4b8251b5609dd0e1089a99fd7b95bf62286ba80337287229f3868eaaa45df317ab9ba1a085a19f71f356a5b29723cf9
|
data/README.md
CHANGED
@@ -7,7 +7,20 @@ A CLI tool to import wordpress xml files into Tumblr via the Tumblr api
|
|
7
7
|
$ gem install wp2tumblr
|
8
8
|
|
9
9
|
## Usage
|
10
|
-
|
10
|
+
|
11
|
+
#### Config
|
12
|
+
Before you will be able to import your posts into Tumblr you will need to configure your Tumblr API credentials.
|
13
|
+
|
14
|
+
$ wp2tumblr config
|
15
|
+
|
16
|
+
You will be asked to register your application, provide your application's secret and public keys, and obtain an oauth_verifier token.
|
17
|
+
|
18
|
+
### Server
|
19
|
+
`wp2tumblr` includes a small Sinatra server to aid in collecting your oauth_verifier token. When you rigister your application just give it the callback url `http://localhost:9292/callback`, open up a seprate terminal window or session and run:
|
20
|
+
|
21
|
+
$ wp2tumblr server
|
22
|
+
|
23
|
+
Now when you visit the redirect url your are given from `wp2tumblr config` you will see the oauth_verifier in your console.
|
11
24
|
|
12
25
|
### Import
|
13
26
|
Once you have completed the config process simply run the following command:
|
@@ -22,22 +35,8 @@ The `-f` option is the absolute path to your wordpress export file, ex. `~/Downl
|
|
22
35
|
|
23
36
|
`wp2tumblr` will sleep one second between each post to not overload the Tumblr api. You will also see feedback stating how many posts were parsed from the wordpress export file as well as the title of each post that is currently being submitted to the Tumblr api.
|
24
37
|
|
25
|
-
## Configuration Tips
|
26
|
-
|
27
|
-
If you're starting completely from scratch with Tumblr here is a basic outline of the steps to take after you have installed this gem.
|
28
|
-
|
29
|
-
#### Register an Application with Tumblr
|
30
|
-
go to [Tumblr Apps](http://www.tumblr.com/oauth/apps), create your application and take note of your OAuth Consumer Key as well as your Consumer Secret Key. You will need to register a callback url to get your `oauth_verifier` token, I created a [Sinatra](https://github.com/sinatra/sinatra) app for this at `http://localhost:4567/callback`.
|
31
|
-
|
32
|
-
#### Configure the Tumblr Client
|
33
|
-
Once you have your application token's run:
|
34
|
-
|
35
|
-
$ tumblr
|
36
|
-
|
37
|
-
You will be prompted to enter your OAuth Consumer key, then your OAuth Consumer Secret. The [tumblr_client gem]('https://github.com/tumblr/tumblr_client') will then output an authorize url, copy and paste that into your browser and your callback url will receive the `oauth_verifier` post containing the OAuth Verifier token.
|
38
|
-
|
39
|
-
|
40
38
|
## Changelog
|
39
|
+
- **Version 0.1.1:** Refactored config process
|
41
40
|
- **Version 0.1.0:** Minor Feature, added Base64 encoding of images
|
42
41
|
- **Version 0.0.1:** Initial Release
|
43
42
|
|
data/bin/wp2tumblr
CHANGED
@@ -14,6 +14,7 @@ opt_parser = OptionParser.new do |opt|
|
|
14
14
|
opt.separator "Commands"
|
15
15
|
opt.separator " text: upload posts as type 'text'"
|
16
16
|
opt.separator " config: configure your Tumblr API credentials"
|
17
|
+
opt.separator " server: start up a sinatra server to capture the oauth_verifier"
|
17
18
|
opt.separator ""
|
18
19
|
opt.separator "Options"
|
19
20
|
|
@@ -32,6 +33,11 @@ puts opt_parser unless ARGV[0]
|
|
32
33
|
|
33
34
|
tumblr_config_path = File.join ENV['HOME'], '.wp2tumblr'
|
34
35
|
|
36
|
+
if ARGV[0] === "server"
|
37
|
+
puts "starting sinatra server, register 'http://localhost:9292/callback' as your apps' callback url."
|
38
|
+
system("rackup -Ilib #{File.join File.dirname(__FILE__), "..", "lib", "server"}/config.ru")
|
39
|
+
end
|
40
|
+
|
35
41
|
if ARGV[0] === "config"
|
36
42
|
api_config = {}
|
37
43
|
puts "Register an application at: #{site}/oauth/apps"
|
data/lib/wp2tumblr/version.rb
CHANGED
data/wp2tumblr.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "oauth"
|
22
22
|
spec.add_dependency "tumblr_client"
|
23
23
|
spec.add_dependency "nokogiri"
|
24
|
+
spec.add_dependency "sinatra"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
26
27
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wp2tumblr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jonlunsford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sinatra
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,6 +151,8 @@ files:
|
|
137
151
|
- README.md
|
138
152
|
- Rakefile
|
139
153
|
- bin/wp2tumblr
|
154
|
+
- lib/server/config.ru
|
155
|
+
- lib/server/sinatra_server.rb
|
140
156
|
- lib/wp2tumblr.rb
|
141
157
|
- lib/wp2tumblr/config.rb
|
142
158
|
- lib/wp2tumblr/tumblr_client.rb
|