PDA

View Full Version : ANN: Release of feature complete Ruby API


pth
Dec-03-2007, 01:59 PM
I in no way want to minimize the efforts done by other Ruby API developers, but I also want to let everyone (who cares) know that the smugmugapi gem is now available:

sudo gem install smugmugapi

or just

gem install smugmugapi
(under windows and for crazy people running as root)

The api is _very_ much like the smugmug api, but with a bit of Ruby sugar:


smugmug.login(email, password) do
tree = smugmug.users.get_tree(:heavy => 1)

tree.each do |category|
next if category.empty?

puts category.name
category.albums.each do |album|
puts " #{album.title}: #{album.image_count}"
end
end

end

Will dump all of your tree with image counts.

smugmug.login(email, password) do
smugmug.upload(fname, :album_id => album)
end

will upload a file. The api can switch between 1.2.0 and 1.2.1 and uses the REST API (uploads use HTTP PUT with a REST response).

It is not well tested, but I do not know of any bugs at the moment. The entire api is supported if you have any problems let me know.

pth (phurley@gmail.com)

rkalla
Dec-04-2007, 04:27 AM
I in no way want to minimize the efforts done by other Ruby API developers, but I also want to let everyone (who cares) know that the smugmugapi gem is now available:

sudo gem install smugmugapi

or just

gem install smugmugapi
(under windows and for crazy people running as root)

The api is _very_ much like the smugmug api, but with a bit of Ruby sugar:


smugmug.login(email, password) do
tree = smugmug.users.get_tree(:heavy => 1)

tree.each do |category|
next if category.empty?

puts category.name
category.albums.each do |album|
puts " #{album.title}: #{album.image_count}"
end
end

end
Will dump all of your tree with image counts.

smugmug.login(email, password) do
smugmug.upload(fname, :album_id => album)
end
will upload a file. The api can switch between 1.2.0 and 1.2.1 and uses the REST API (uploads use HTTP PUT with a REST response).

It is not well tested, but I do not know of any bugs at the moment. The entire api is supported if you have any problems let me know.

pth (phurley@gmail.com)

Very very cool pth, nice work!