A simple API client which can interact with the Webs.com REST-based API. Initializing a WebsApi object is as simple as:
> require 'webs_api' > webs_api = Webs::WebsApi.new
or alternatively, if you have an OAuth token you’d like to use:
> webs_api = Webs::WebsApi.new(oauth_token)
To install, just install the Gem:
$ gem install webs_api
webs_api.get_apps
webs_api.get_app('calendar')
or
webs_api.get_app(5)
webs_api.install_app('patrick', :handle => 'webstore') webs_api.uninstall_app('patrick', 'webstore')
webs_api.get_templates
webs_api.get_template(127)
webs_api.get_template_styles(127)
webs_api.get_template_style(251)
webs_api.get_site('patrick')
or alternatively if you have a site ID, rather than a username:
webs_api.get_site(1127604)
webs_api.update_site('patrick', :title => "My Site Title", :footer => "My Footer", :description => "My Site Description", :sidebars_enabled => true, :social => true, keywords => ['my', 'site', 'keywords'], :template_id => 127, :custom_css_url => "http://somesite.com/somestyle.css")
To get all members of a site:
webs_api.get_site_members('patrick')
And to get a specific member:
webs_api.get_site_member('patrick', '[email protected]')
You can also use an ID of the site member rather than the email
-
Patrick Carroll (github.com/patrickwebs)
Apache License, Version 2.0