Oops, still need email and pass. Update usage comment
This commit is contained in:
parent
c3b12457a0
commit
19fc8cb488
|
@ -5,7 +5,7 @@ require 'net/http'
|
||||||
require 'uri'
|
require 'uri'
|
||||||
require "json"
|
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 Jekyll
|
||||||
module Posterous
|
module Posterous
|
||||||
|
@ -27,10 +27,11 @@ module Jekyll
|
||||||
end
|
end
|
||||||
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"
|
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
|
page = 1
|
||||||
|
|
||||||
while posts.any?
|
while posts.any?
|
||||||
|
@ -59,7 +60,7 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
page += 1
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue