Created
March 9, 2011 19:58
-
-
Save wonderchook/862870 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
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