Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Oops, still need email and pass. Update usage comment

  • Loading branch information...
commit 19fc8cb4882e8241025dfd59f75bbcc42643ffa6 1 parent c3b1245
@nfm authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/jekyll/migrators/posterous.rb
View
9 lib/jekyll/migrators/posterous.rb
@@ -5,7 +5,7 @@
require 'uri'
require "json"
-# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, blog)'
+# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, api_key, blog)'
module Jekyll
module Posterous
@@ -27,10 +27,11 @@ def self.fetch(uri_str, limit = 10)
end
end
- def self.process(api_token, blog = 'primary')
+ def self.process(email, pass, api_token, blog = 'primary')
+ @email, @pass, @api_token = email, pass, api_token
FileUtils.mkdir_p "_posts"
- posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{api_token}").body)
+ posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{@api_token}").body)
page = 1
while posts.any?
@@ -59,7 +60,7 @@ def self.process(api_token, blog = 'primary')
end
page += 1
- posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{api_token}&page=#{page}").body)
+ posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{@api_token}&page=#{page}").body)
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.