Created
September 24, 2008 16:39
-
-
Save bryanl/12596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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