################################################################ # # ERINSBOROUGH # # Version 3.1 # Author: kaolincash, neuralwarp # Date: 17th June 2016 # Email: kaolin@maia.cash # # Special thanks to: the Tin Man, newmaritk1 # ################################################################ require 'open-uri' require 'net/ftp' require 'date' current_time = DateTime.now time = current_time.strftime "%d/%m/%Y %H:%M" tmpdir = 'tmp' tmpfile = tmpdir + '/tmp.tmp' unless Dir[tmpdir].empty? File.delete tmpfile Dir.rmdir tmpdir end ramsay = open('http://www.dailymotion.com/user/newmaritk1/search/Neighbours/1') text = ramsay.read.downcase ramsay.close Dir.mkdir "tmp" path = "tmp" street = open("./tmp/tmp.tmp", "w") street.write ' Ramsay Street
' id = [] 5.times { video = text.match(/\" href=\"\/video\/([a-z0-9]+)\D+(\d+)/) break unless video id += [$1] text = $' } id.reverse.each {|episode| street.write '

' } street.write '
' street.close ep1 = $2 ep5 = (ep1.to_i + 4).to_s week = ep1 + "-" + ep5 Dir.mkdir(path + "/" + week ,0644) uri = URI.parse('ftp://clansoul:01202251593@maia.cash/maia.cash/neighbours/' + week) ftp = Net::FTP.new ftp.connect(uri.host, uri.port) ftp.passive = true ftp.login(uri.user, uri.password) upload = path + "/" + week + "/" + "index.html" File.rename("./tmp/tmp.tmp", upload) ftp.mkdir(uri.path) ftp.chdir(uri.path) ftp.putbinaryfile(upload) ftp.close File.delete upload Dir.rmdir (path + "/" + week) Dir.rmdir path Dir.mkdir "tmp" path = "tmp" latest = open("./tmp/tmp.tmp", "w") latest.write 'document.write("Updated on: '+time+'")' latest.close Dir.mkdir(path + "/new" ,0644) uri = URI.parse('ftp://clansoul:01202251593@maia.cash/maia.cash/neighbours/new') ftp = Net::FTP.new ftp.connect(uri.host, uri.port) ftp.passive = true ftp.login(uri.user, uri.password) upload = path + "/" + "latest.js" File.rename("./tmp/tmp.tmp", upload) ftp.mkdir(uri.path) ftp.chdir(uri.path) ftp.putbinaryfile(upload) ftp.close File.delete upload Dir.rmdir (path + "/new") Dir.rmdir path