Skip to content

Commit

Permalink
Oops, still need email and pass. Update usage comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Firth-McCoy committed Jan 18, 2012
1 parent c3b1245 commit 19fc8cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/jekyll/migrators/posterous.rb
Expand Up @@ -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
Expand All @@ -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?
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 19fc8cb

Please sign in to comment.