Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- res=db.query("SELECT active,mail, CONVERT(message USING utf8) FROM autoresponder WHERE moddate >= SUBTIME(NOW(), \"666:15:0\");")
- # jeśli zapytanie nie zwraca wyników, zakończ
- if res.num_rows<1
- res.free
- db.close
- exit
- end
- # główna pętla
- for t in res
- # jeśli active == 1
- if t[0] == "1"
- # wyciąganie loginu z pola mail
- login=t[1].split("@")[0]
- # wyciąganie domeny z pola mail
- tmp=t[1].split(".")
- tmp.shift
- domain=tmp.join(".")
- msg=t[2]
- File.open("#{login}", "w") do |f|
- f.write("#{msg}")
- end
- # else
- # puts "to sa nieaktywne autorespondery"
- # puts "active: #{t[0]}"
- # puts "mail: #{t[1]}"
- # puts "message: #{t[2]}"
- end
- end
- res.free
- db.close
Add Comment
Please, Sign In to add comment