Skip to content

Instantly share code, notes, and snippets.

@fcecagno
Created July 23, 2014 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcecagno/082230a2d60a3d4880dc to your computer and use it in GitHub Desktop.
Save fcecagno/082230a2d60a3d4880dc to your computer and use it in GitHub Desktop.
Fetch metadata
#!/usr/bin/ruby
require 'uri'
require 'fileutils'
url = ARGV[0]
uri = URI.parse(url)
meeting_id = uri.query.sub(/meetingId=/, '')
file_repo = "#{uri.scheme}://#{uri.host}/presentation/#{meeting_id}"
metadata_xml = "#{file_repo}/metadata.xml"
published_dir = "/var/bigbluebutton/published/presentation/#{meeting_id}"
FileUtils.rm_rf published_dir
FileUtils.mkdir_p published_dir
command = "/usr/bin/curl --output #{published_dir}/metadata.xml #{metadata_xml}"
system(command)
FileUtils.touch "/var/bigbluebutton/recording/status/sanity/#{meeting_id}.done"
puts "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment