educatic-info/bin/nextcloud/lib.rb

23 lines
454 B
Ruby
Raw Normal View History

2022-12-01 15:22:21 +01:00
require "dotenv"
require "nextcloud"
def get_nextcloud_object
settings = Dotenv.load
nextcloud = Nextcloud.new(
url: settings["URL"],
username: settings["USERNAME"],
password: settings["PASSWORD"]
)
return nextcloud
end
def get_filesharing_object
settings = Dotenv.load
fs = Nextcloud::Ocs::FileSharingApi.new(
url: settings["URL"],
username: settings["USERNAME"],
password: settings["PASSWORD"]
)
return fs
end