Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #472 from nfm/patch-1

Update Posterous migrator to take an api_token
  • Loading branch information...
commit e27e2554d9abf66c7c333990386a17a59ba0f8cd 2 parents 2da64d9 + 19fc8cb
@mojombo mojombo authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/jekyll/migrators/posterous.rb
View
7 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,9 +27,8 @@ def self.fetch(uri_str, limit = 10)
end
end
- def self.process(email, pass, blog = 'primary')
- @email, @pass = email, pass
- @api_token = JSON.parse(self.fetch("/api/2/auth/token").body)['api_token']
+ 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)
Please sign in to comment.
Something went wrong with that request. Please try again.