Skip to content

Commit e27e255

Browse files
committed
Merge pull request jekyll#472 from nfm/patch-1
Update Posterous migrator to take an api_token
2 parents 2da64d9 + 19fc8cb commit e27e255

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/jekyll/migrators/posterous.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'uri'
66
require "json"
77

8-
# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, blog)'
8+
# ruby -r './lib/jekyll/migrators/posterous.rb' -e 'Jekyll::Posterous.process(email, pass, api_key, blog)'
99

1010
module Jekyll
1111
module Posterous
@@ -27,9 +27,8 @@ def self.fetch(uri_str, limit = 10)
2727
end
2828
end
2929

30-
def self.process(email, pass, blog = 'primary')
31-
@email, @pass = email, pass
32-
@api_token = JSON.parse(self.fetch("/api/2/auth/token").body)['api_token']
30+
def self.process(email, pass, api_token, blog = 'primary')
31+
@email, @pass, @api_token = email, pass, api_token
3332
FileUtils.mkdir_p "_posts"
3433

3534
posts = JSON.parse(self.fetch("/api/v2/users/me/sites/#{blog}/posts?api_token=#{@api_token}").body)

0 commit comments

Comments
 (0)