Last active
August 29, 2015 14:15
-
-
Save huseyin/36bd6769befe63637123 to your computer and use it in GitHub Desktop.
Dosyadan alınan mail adreslerinden takma isim oluştur
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
# | |
# From-> Hüseyin Tekinaslan <huseyin.tekinaslan@bil.omu.edu.tr> | |
# | |
class Sortname | |
def initialize(adress) | |
@adress = adress | |
end | |
# | |
def to_mail | |
cuting = @adress.split("@")[0] | |
domain = cuting.split(/[aeıioöuü]/) | |
return domain.join() | |
end | |
# | |
end | |
def main() | |
print "File:" | |
file = gets.chomp | |
File.open(file, "r").readlines.each do |mail| | |
if mail.include?("@") | |
sending = Sortname.new(mail)::to_mail | |
puts "\033[93m", sending | |
end | |
end | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment