Skip to content

Instantly share code, notes, and snippets.

@wonderchook
Created March 9, 2011 19:58
Show Gist options
  • Save wonderchook/862870 to your computer and use it in GitHub Desktop.
Save wonderchook/862870 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rest_client'
require 'json'
def update_layer(server_instance, update_info, layer_id)
response = server_instance['datasets/' + layer_id + '.json'].put update_info, :ContentType=>'application/json'
end
server_url = "http://geocommons.com"
server_instance = RestClient::Resource.new(server_url,:user => 'kate', :password => '#####')
dataset_id = "98765"
update_info = {:title => "Changed the Title", :permissions => {:group_id => "20647",:permissions => {:view => true,:download => true,:edit => false}}}
update_layer(server_instance, update_info, dataset_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment