Permalink
Browse files

Oops, still need email and pass. Update usage comment

  • Loading branch information...
1 parent c3b1245 commit 19fc8cb4882e8241025dfd59f75bbcc42643ffa6 @nfm nfm committed Jan 18, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 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

1 comment on commit 19fc8cb

@kevinSuttle

Getting 500 Internal Errors when trying to run this. The API site seems fine, but I'm not sure if the API itself is having issues.

Please sign in to comment.