Jump to content
sclipici

[RST] Mail Sorter

Recommended Posts


<?php
/*
RST
Visit www.rstforums.com
Mail Sorter by sclipici
Use: rst_sort('file_name.extension');

*/
function rst_sort($n){
$mails = file_get_contents($n);
$mails = array_filter(explode("\n", $mails));
foreach ($mails as $key => $value) {
$e = explode("@", $value);

$a[][$e[1]] = $e[0];
}

foreach ($a as $key => $value) {
foreach ($value as $k => $v) {
file_put_contents($k.'.txt', $v.'@'.$k. PHP_EOL, FILE_APPEND);

}
}
echo 'Visit www.rstforums.com';
}

Link to comment
Share on other sites


<?php
/*
RST
Visit www.rstforums.com
Mail Sorter by sclipici
Use: rst_sort('file_name.extension');

*/
function rst_sort($n){
$mails = file_get_contents($n);
$mails = array_filter(explode("\n", $mails));
foreach ($mails as $key => $value) {
$e = explode("@", $value);

$a[][$e[1]] = $e[0];
}

foreach ($a as $key => $value) {
foreach ($value as $k => $v) {
file_put_contents($k.'.txt', $v.'@'.$k. PHP_EOL, FILE_APPEND);

}
}
echo 'Visit www.rstforums.com';
}

Sau mai simplu:


sort -u emails.txt

Link to comment
Share on other sites

Sau incearca ceva de genul:

bad=["@gmail.com","@gov.com","@gov","@gov.de","@yahoo.com","mail.ru","yahoo.ca","yahoo","gmail.com","yahoo.com","googlemail.com","hotmail.com","hotmail.co.uk","hotmail.de","hotmail.co.uk","yahoo.ro","outlook.com","live.com","mail","yadex","aol","hotmail","live","outlook","gmail","msn","forbes"]
l=open("listaEmailuri.txt","r").read().splitlines()
for j in l:
e=j.split("@")
if "@" in j and e[1].lower().split(".")[0] not in bad:
open("1.txt","a").write(j+"\n")
else:
open("0.txt","a").write(j+"\n")

Unde python parser.py , si parseaza din listaEmailuri.txt

Link to comment
Share on other sites

App. Nu e chiar ca sort -u, iti creeaza un fiser pentru fiecare extensie de email-uri. Daca nu vreti sa-l folositi, nu mai postati aiurea.

de cand esti tu asa guru al linuxului? ai incercat sa dai sort -u pe un fisier ce contine mailuri si sa vezi ce se intampla?

nu tre sa ai linux, e de ajuns un cygwin amarat Babun - a windows shell you will love!

omul a oferit tuturor o alternativa rezonabila, nu mai plange ca o pizda ca nu esti ridicat in slavi pentru scriptul tau, nu poti forta lumea sa te aprecieze

Edited by black_death_c4t
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...