Skip to content

Instantly share code, notes, and snippets.

@bryanl
Created September 24, 2008 16:39
Show Gist options
  • Save bryanl/12596 to your computer and use it in GitHub Desktop.
Save bryanl/12596 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
# you can get this from the 'atom-tools' gem
require 'atom/service'
service = Atom::Service.new "http://downloadr.local/sites"
collection = service.workspaces.first.collections.first
puts collection.feed.entries.inspect
# publish with atom
# I'm going to assume you are going to change this to something else.
guts = IO.read("file.png")
s = collection.post_media! guts, "application/octet-stream", "file.png"
# check the collection feed
collection.feed.update!
puts collection.inspect
puts collection.feed.entries.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment