Module: Posterous::OldAPI

Includes:
BaseURI
Included in:
User
Defined in:
lib/posterous_api/old_api.rb

Instance Method Summary collapse

Methods included from BaseURI

#base_uri

Instance Method Details

#get_all_sites_uriObject



9
10
11
# File 'lib/posterous_api/old_api.rb', line 9

def get_all_sites_uri
  @get_all_sites_uri ||= "#{base_uri}/getsites"
end

#get_tags_uriObject

The get tags uri to get all the tags

Fields:

"site_id" - Optional. Id of the site to read from
"hostname" - Optional. Subdomain of the site to read from


19
20
21
# File 'lib/posterous_api/old_api.rb', line 19

def get_tags_uri
  @get_tags_uri ||= "#{base_uri}/gettags"
end

#new_post_uriObject

Fields:

"site_id" - Optional. Id of the site to post to. If not supplied, posts to the user's default site
"media" - Optional. File data for single file.
"media[]" - Optional. File data for multiple file upload. Can be specified multiple times.
"title" - Optional. Title of post
"body" - Optional. Body of post
"autopost" - Optional. 0 or 1.
"private" - Optional. 0 or 1.
"date" - Optional. In GMT. Any parsable format. Cannot be in the future.
"tags" - Optional. Comma separate tags
"source" - Optional. The name of your application or website
"sourceLink" - Optional. Link to your application or website


49
50
51
# File 'lib/posterous_api/old_api.rb', line 49

def new_post_uri
  @new_post_uri ||= "#{base_uri}/newpost"
end

#read_posts_uriObject

The read posts uri to get all the posts from a site

Fields:
"site_id" - Optional. Id of the site to read from
"hostname" - Optional. Subdomain of the site to read from
"num_posts" - Optional. How many posts you want. Default is 10, max is 50
"page" - Optional. What 'page' you want (based on num_posts). Default is 1
"tag" - Optional


32
33
34
# File 'lib/posterous_api/old_api.rb', line 32

def read_posts_uri
  @read_posts_uri ||= "#{base_uri}/readposts"
end

#update_post_uriObject

Fields:

"post_id" - Id of the post to update.
"media" - Optional. File data for single file. Will append to post.
"media[]" - Optional. File data for multiple file upload. Can be specified multiple times. Will append to post.
"title" - Optional. Title of post. Will update post if present.
"body" - Optional. Body of post. Will update post if present.


60
61
62
# File 'lib/posterous_api/old_api.rb', line 60

def update_post_uri
  @update_post_uri ||= "#{base_uri}/updatepost"
end