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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa3cb0fc81507ba8122d6dfdfe7092fda46be2b5
4
- data.tar.gz: dc2c48808a149bd84ca16020207fb833c2a96650
3
+ metadata.gz: 1b4b19027d615019e3b447a34005f0e265479f6d
4
+ data.tar.gz: 24b148146d1591997d7d0afe6bff14ba003b9fab
5
5
  SHA512:
6
- metadata.gz: 88090ceaa17c302081022e2ed2b538f087a1558393fbf34548f7077ef3ce52cc13ac8894a8dd5654e22c4f5a79df5a6f115a1ec545a9de527a9125fe7266be76
7
- data.tar.gz: e352f6afa69a041df9645b52da2f492ca9d6a5a54e5c2a7f6a8aba6928e4e0e29a29826550ca16b7184610b5e82cdee15b0049fc180a292f168fc792d8421556
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
- This gem is dependant on the `~/.tumblr` config file that the [tumblr_client gem](https://github.com/tumblr/tumblr_client) generates. If you have not previously installed the [tumblr_client gem](https://github.com/tumblr/tumblr_client) and have run the [irb console setup](https://github.com/tumblr/tumblr_client#the-irb-console) you will be prompted to do so upon first use of this gem.
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"
@@ -0,0 +1,3 @@
1
+ $:.unshift File.expand_path("../", __FILE__)
2
+ require "#{File.join File.dirname(__FILE__)}/sinatra_server"
3
+ run Sinatra::Application
@@ -0,0 +1,5 @@
1
+ require "sinatra"
2
+
3
+ get "/callback" do
4
+ puts "Your oauth_verifier token: #{params[:oauth_verifier]}"
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Wp2tumblr
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.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-26 00:00:00.000000000 Z
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