Skip to content

Instantly share code, notes, and snippets.

@tobi
Created December 9, 2008 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobi/33919 to your computer and use it in GitHub Desktop.
Save tobi/33919 to your computer and use it in GitHub Desktop.
# ==================
# After login
# getting all blogs for a drop down:
blogs = ShopifyAPI::Blog.find(:all)
blogs.each do |blog|
blog.id #=> 439432
blog.title #=> "My cool blog"
end
# Now you can save the permission token (password) and the selected blog Id to your database.
# For more information on blogs see http://www.shopify.com/developers/api/blog.html
# ===================
# Posting an article
ShopifyAPI::Article.new(
:blog_id => posterous_blog_id,
:title => 'My new Article title',
:body => "<notextile>#{posterous_body}</notextile>"
)
# For more information on articles you can go to
# http://www.shopify.com/developers/api/article.html#create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment