lib/saber/tracker/bb.rb in saber-1.2.3 vs lib/saber/tracker/bb.rb in saber-1.2.4

- old
+ new

@@ -1,9 +1,8 @@ module Saber module Tracker - # DOESN'T WORK for mechanize does not support javascript. - class BB < Base + class BB < Gazelle BASE_URL = "https://baconbits.org" LOGIN_CHECK_PATH = "/inbox.php" FIELDS = { "Musics" => { @@ -177,35 +176,9 @@ "image" => :text, "scene" => :checkbox, }, } - # Upload one torrent file to the site. - # - # @param [String] file a filename - # @param [Optimism] info comes from <file>.yml data file. - # - # @return [Boolean] result-code - def do_upload(file, info) - info["file_input"] = "#{file}.torrent" - - agent.get("/upload.php") {|p| - ret = p.form_with(action: "") {|f| - FIELDS[info.type].each {|k,t| - f.set(t, k, info[k]) - } - }.submit - - if ret.uri.path == "/upload.php" - msg = ReverseMarkdown.parse(ret.at("//*[@id='content']/div[2]/p[2]")) - Saber.ui.error "ERROR: #{msg.to_s.strip}\n" - return false - else - return true - end - } - end - protected # Attpened to login the site with username and password. this happens # after login failed with cookie. def do_login_with_username(username)