Module: Postly

Extended by:
Postly
Included in:
Postly
Defined in:
lib/postly.rb,
lib/postly/post.rb,
lib/postly/site.rb,
lib/postly/comment.rb,
lib/postly/connection.rb,
lib/postly/many_proxy.rb,
lib/postly/blog_importer.rb

Defined Under Namespace

Classes: BlogImporter, Comment, Connection, ManyProxy, Post, PostlyError, Site

Constant Summary collapse

SITE_ATTRS =
[:name,    :url,      :private, :primary,   :hostname,  :commentsenabled, :num_posts, :id]
POST_ATTRS =
[:site_id, :title,    :body,    :autopost,  :private,   :date,            :tags,      :source, :sourceLink, :id, :url]
COMMENT_ATTRS =
[:post_id, :comment,  :name,    :email,     :date]

Instance Method Summary collapse

Instance Method Details

#base_uriObject



27
28
29
# File 'lib/postly.rb', line 27

def base_uri
  @base_uri ||= "http://posterous.com/api"
end

#configObject



18
19
20
# File 'lib/postly.rb', line 18

def config
  @config ||= File.open(File.join(Dir.getwd, 'config/posterous.yml'), 'r') { |f| YAML.load(f) }
end

#config=(path) ⇒ Object



22
23
24
# File 'lib/postly.rb', line 22

def config=(path)
  @config =  File.open(path, 'r') { |f| YAML.load(f) }
end

#encoded_credentialsObject

Base64 Encoding credentials for Basic Auth



14
15
16
# File 'lib/postly.rb', line 14

def encoded_credentials  
  @credentials ||= Base64.encode64("#{config['username']}:#{config['password']}")
end