
import os
fileList = os.listdir('.') #replace the . with your article directory

foreignList=['(4E)',
'(AA)',
'(AAP)',
'(ABR)',
'(AFNEWS)',
'(AFP)',
'(AFPS)',
'(AGERPRES)',
'(AGI)',
'(AHN)',
'(AIP)',
'(AMNA)',
'(ANA)',
'(ANI)',
'(ANN)',
'(ANNCOL)',
'(ANP)',
'(ANSA)',
'(ANTARA)',
'(AP)',
'(APA)',
'(APEM)',
'(APP)',
'(APS)',
'(APTN)',
'(ASPA)',
'(ATP)',
'(ATS)',
'(AzerTAc)',
'(BELGA)',
'(BERNAMA)',
'(BNA)',
'(BNS)',
'(BSS)',
'(BTA)',
'(CNA)',
'(CNS)',
'(CP)',
'(CPS)',
'(CTK)',
'(DND)',
'(DPA)',
'(EFE)',
'(ELTA)',
'(ENA)',
'(ENAB)',
'(ENS)',
'(EPA)',
'(FNA)',
'(GIN)',
'(GNN)',
'(HAL)',
'(HINA)',
'(IANA)',
'(IANS)',
'(ICANA)',
'(ICC)',
'(IHA)',
'(IINA)',
'(ILNA)',
'(IMC)',
'(INN)',
'(INS)',
'(IPNA)',
'(IPS)',
'(IRIB)',
'(IRIN)',
'(IRNA)',
'(ISNA)',
'(ITIM)',
'(IWNA)',
'(JTA)',
'(KC)',
'(KCNA)',
'(KNA)',
'(KPL)',
'(LETA)',
'(LNS)',
'(LUSA)',
'(MAP)',
'(MERIP)',
'(MNA)',
'(MPA)',
'(MTI)',
'(MTI)',
'(MVAN)',
'(NAMPA)',
'(NAN)',
'(NANAP)',
'(NEP)',
'(NINA)',
'(NNI)',
'(NNN)',
'(NTB)',
'(NZPA)',
'(NZPA)',
'(OANA)',
'(PA)',
'(PANA)',
'(PAP)',
'(PAT)',
'(PIA)',
'(PINR)',
'(PNA)',
'(PNS)',
'(PPI)',
'(PTI)',
'(QNA)',
'(Rador)',
'(Ritzau)',
'(SABA)',
'(SANA)',
'(SB)',
'(SDA)',
'(SPA)',
'(STA)',
'(STT)',
'(TASR)',
'(TASS)',
'(TDH)',
'(TELAM)',
'(TI)',
'(TT)',
'(TWT)',
'(UNB)',
'(UNI)',
'(UNIAN)',
'(UPI)',
'(VIANEWS)',
'(WAM)',
'(WENN)',
'(WSPA)',
'(XINHUA)',
'(YONHAP)',
'(ZENIT)',
'ABN Newswire',
'ABNewswire',
'adnkronos',
'Afghan Islamic Press',
'African Press Organization',
'Afrol',
'Ag[eé]nce T[eé]legraphique Suisse',
'Ag[êe]ncia Noticiosa Portuguesa',
'Agence de presse [eé]tudiante mondiale',
'agence france press',
'agence france-presse',
'Agence France-Presse',
'agência brasil',
'Agencia de Noticias Latinoamericana',
'Agencia de Noticias Nueva Colombia',
'agencia efe','agenparl',
'agentia de Presă RADOR',
'Agenția Română de Presă',
'Agenzia Giornalistica Italia',
'Agenzia Nazionale Stampa Associata',
'Agenzia telegrafica svizzera',
'Air Force News Agency',
'Algemeen Nederlands Persbureau',
'Algeria Press Service',
'Algeria\'s News Agency',
'All Headline News',
'AlterNet',
'america pioneer news',
'American Forces Press Service',
'Anadolu Agency',
'(Anka)',
'Anka Haber Ajansi',
'<NAME>',
'ANSAmed',
'Antara',
'Aotearoa Student Press Association',
'Apsnypress',
'Armenpress',
'Asian News International',
'Asian News Network',
'Associated Press',
'Associated Press of Pakistan',
'Associated Press Service',
'Assyrian International News Agency',
'Athens News Agency',
'Athens News Agency-Macedonian Press Agency',
'Australian Associated Press',
'Austria Presse Agentur',
'Azad News Agency',
'Azerbaijan Press Agency',
'Azerbaijan State Telegraph Agency',
'Bahrain News Agency',
'Bakhtar News Agency',
'Baltic News Service',
'Bangladesh Sangbad Shangstha',
'Bay City News',
'Belarusian Telegraph Agency',
'Belga',
'Belga',
'BelTA',
'Bernama',
'Bhartiya Broadcast',
'Bloomberg',
'Bloomberg L.P.',
'Bloomberg News',
'BNO News',
'BreakingNewsOn',
'Bulgarian News Agency',
'Bulgarian Telegraph Agency',
'Business Wire',
'Canadian Press',
'Canadian University Press',
'Capital News Service',
'Catholic News Service',
'(CCTV)',
'Center for Public Integrity',
'Central News Agency',
'Chechenpress',
'Children\'s Express',
'China News Service',
'C<NAME>',
'Cihan News Agency',
'Cision',
'CNW Group',
'College Press Service',
'Courthouse News Service',
'Croatian News Agency',
'CSRWire',
'CSRWire Canada',
'Cyprus News Agency',
'Czech News Agency',
'Deca-press',
'Defacto.am',
'Deutsche Presse-Agentur',
'Dispatch News Desk',
'Dispatch News Service',
'<NAME>',
'Dow Jones Newswires',
'(dpa)',
'EcoWin',
'Ehlas News Agency',
'Emirates News Agency',
'Environment and Energy Publishing',
'Environment News Service',
'Ethiopian News Agency',
'European News Agency Belgium',
'European Pressphoto Agency',
'Extel',
'Fars News Agency',
'Ferghana Information Agency',
'Fourth Estate',
'German News',
'GermNews',
'GiraEnLaRed',
'Global Information Network',
'GlobeNewswire',
'Gongwer News Service',
'Guerrilla News Network',
'Hacktivist News Service',
'Hetq Online',
'Hugin',
'IES News Service',
'Ihlas Haber Ajansi',
'Ihlas News Agency',
'Independent Media Center',
'Independent Network News',
'Indo-Asian News Service',
'Indybay',
'Indymedia',
'Information Technology News Agency',
'Information Telegraph Agency of Russia',
'Integrated Regional Information Networks',
'Inter Press Service',
'Inter Press Service',
'Interfax',
'International Islamic News Agency',
'International News Service',
'International Press Telecommunications Council',
'Iran Cultural Heritage', 
'Handcrafts and Tourism Organization',
'Iran Pas News Agency',
'IranDokht','Iranian Agriculture News Agency',
'Iranian Labour News Agency',
'Iranian Students\' News Agency',
'Islamic Consultative Assembly News Agency',
'Islamic Republic News Agency',
'Islamic Republic of Iran Broadcasting',
'Italian Journalist Agency',
'ITAR-Tass',
'Japan Corporate News Network',
'Jewish Telegraphic Agency',
'Jiji Press',
'Kavkaz Center',
'Kenya News Agency',
'KIpress News Agency',
'Korea Newswire',
'Korean Central News Agency',
'Kosovo\'s News Agency',
'Kyodo News',
'Lao News Agency',
'Liberation News Service',
'Lipper','Lusa News Agency',
'Macauhub',
'Macedonian Press Agency',
'Maghreb Arab Press',
'<NAME>',
'Maine Video Activists Network',
'Makfax',
'Malaysian National News Agency',
'Mehr News Agency',
'Middle East Research and Information Project',
'Mizzima News',
'Moldpres',
'Montena informativna agencija',
'NAM News Network',
'Namibia Press Agency',
'National Election Pool',
'National Iraqi News Agency',
'New Colombia News Agency',
'New Zealand Press Association',
'Newratings',
'News Agency of Nigeria',
'News Agency of the Slovak Republic',
'News Network International',
'Non-Aligned News Agencies Pool',
'Norsk Telegrambyrå',
'Norwegian News Agency',
'Notimex',
'NurPhoto Agency',
'Online International News Network',
'OpEdNews',
'Organization of Asia-Pacific News Agencies',
'Pacific News Service',
'Pacnews',
'Pakistan Press International',
'PanARMENIAN.Net',
'Petra',
'Peyamner News Agency',
'Philippine News Agency',
'PlusNews',
'Polish Press Agency',
'Polish Telegraphic Agency',
'Polska Agencja Prasowa',
'Polska Agencja Telegraficzna',
'Portuguese News Agency',
'Power and Interest News Report',
'PR Newswire',
'PR Web',
'Prensa Latina',
'Press Association',
'Press Trust of India',
'Pressclub Information Agency',
'Pupils Association News Agency',
'Qatar News Agency',
'Rasa News Agency',
'Relaxnews',
'Reuters',
'Reuters Market Data System',
'RIA Novosti',
'Ritzau',
'<NAME>',
'Rmds',
'<NAME>',
'Romanian Press Agency',
'<NAME>',
'Ruptly',
'Russian Information Agency',
'Russian News Agency TASS',
'Saba News Agency',
'<NAME>',
'Sapa',
'Saudi Press Agency',
'Schweizerische Depeschenagentur',
'Sipa USA',
'Slovenian Press Agency',
'South African Press Association',
'<NAME>',
'Syrian Arab News Agency',
'T[eé]lam',
'Tahitipresse',
'TAK-Cyprus',
'Tanjug',
'Telegraph Agency of the Soviet Union',
'Telenoticiosa Americana',
'The Canadian Press',
'The Real News',
'Tidningarnas Telegrambyr[aå]',
'Tidningarnas Telegrambyrå',
'Times Of India',
'Trust of India',
'Turkish News Agency-Cyprus',
'Turkmenistan State News Agency',
'Ukrainian Independent Information Agency',
'United Media',
'United News of Bangladesh',
'United News of India',
'United Press',
'United Press International',
'Via News Agency',
'Vietnam News Agency',
'Voice of Korea',
'Wales and West News & Sport',
'Wion Tv',
'World Entertainment News Network',
'World Student Press Agency',
'Xinhua News Agency',
'Yemen News Agency',
'Yonhap',
'Yonhap News Agency',
'Zee News',
'Zenit News Agency',
'ZUMA Press']
print('Number of Files Start : ',len(fileList))
for filename in fileList:
    f = open('.'+filename, 'r')  # #replace the . with your article directory
    fileContent = f.read()
    if [ele for ele in foreignList if(ele in fileContent)]:
        f.close()
        os.remove('.'+filename)   ##replace the . with your article directory
        print('DELETED ARTICLE : ', filename)
    else:
        f.close()
fileList = os.listdir('.')   # replace the . with your article directory
print('Number of Files End : ',len(fileList))

import os
fileList = os.listdir('.') #replace the . with your article directory

foreignList=['(4E)',
'(AA)',
'(AAP)',
'(ABR)',
'(AFNEWS)',
'(AFP)',
'(AFPS)',
'(AGERPRES)',
'(AGI)',
'(AHN)',
'(AIP)',
'(AMNA)',
'(ANA)',
'(ANI)',
'(ANN)',
'(ANNCOL)',
'(ANP)',
'(ANSA)',
'(ANTARA)',
'(AP)',
'(APA)',
'(APEM)',
'(APP)',
'(APS)',
'(APTN)',
'(ASPA)',
'(ATP)',
'(ATS)',
'(AzerTAc)',
'(BELGA)',
'(BERNAMA)',
'(BNA)',
'(BNS)',
'(BSS)',
'(BTA)',
'(CNA)',
'(CNS)',
'(CP)',
'(CPS)',
'(CTK)',
'(DND)',
'(DPA)',
'(EFE)',
'(ELTA)',
'(ENA)',
'(ENAB)',
'(ENS)',
'(EPA)',
'(FNA)',
'(GIN)',
'(GNN)',
'(HAL)',
'(HINA)',
'(IANA)',
'(IANS)',
'(ICANA)',
'(ICC)',
'(IHA)',
'(IINA)',
'(ILNA)',
'(IMC)',
'(INN)',
'(INS)',
'(IPNA)',
'(IPS)',
'(IRIB)',
'(IRIN)',
'(IRNA)',
'(ISNA)',
'(ITIM)',
'(IWNA)',
'(JTA)',
'(KC)',
'(KCNA)',
'(KNA)',
'(KPL)',
'(LETA)',
'(LNS)',
'(LUSA)',
'(MAP)',
'(MERIP)',
'(MNA)',
'(MPA)',
'(MTI)',
'(MTI)',
'(MVAN)',
'(NAMPA)',
'(NAN)',
'(NANAP)',
'(NEP)',
'(NINA)',
'(NNI)',
'(NNN)',
'(NTB)',
'(NZPA)',
'(NZPA)',
'(OANA)',
'(PA)',
'(PANA)',
'(PAP)',
'(PAT)',
'(PIA)',
'(PINR)',
'(PNA)',
'(PNS)',
'(PPI)',
'(PTI)',
'(QNA)',
'(Rador)',
'(Ritzau)',
'(SABA)',
'(SANA)',
'(SB)',
'(SDA)',
'(SPA)',
'(STA)',
'(STT)',
'(TASR)',
'(TASS)',
'(TDH)',
'(TELAM)',
'(TI)',
'(TT)',
'(TWT)',
'(UNB)',
'(UNI)',
'(UNIAN)',
'(UPI)',
'(VIANEWS)',
'(WAM)',
'(WENN)',
'(WSPA)',
'(XINHUA)',
'(YONHAP)',
'(ZENIT)',
'ABN Newswire',
'ABNewswire',
'adnkronos',
'Afghan Islamic Press',
'African Press Organization',
'Afrol',
'Ag[eé]nce T[eé]legraphique Suisse',
'Ag[êe]ncia Noticiosa Portuguesa',
'Agence de presse [eé]tudiante mondiale',
'agence france press',
'agence france-presse',
'Agence France-Presse',
'agência brasil',
'Agencia de Noticias Latinoamericana',
'Agencia de Noticias Nueva Colombia',
'agencia efe','agenparl',
'agentia de Presă RADOR',
'Agenția Română de Presă',
'Agenzia Giornalistica Italia',
'Agenzia Nazionale Stampa Associata',
'Agenzia telegrafica svizzera',
'Air Force News Agency',
'Algemeen Nederlands Persbureau',
'Algeria Press Service',
'Algeria\'s News Agency',
'All Headline News',
'AlterNet',
'america pioneer news',
'American Forces Press Service',
'Anadolu Agency',
'(Anka)',
'Anka Haber Ajansi',
'<NAME>',
'ANSAmed',
'Antara',
'Aotearoa Student Press Association',
'Apsnypress',
'Armenpress',
'Asian News International',
'Asian News Network',
'Associated Press',
'Associated Press of Pakistan',
'Associated Press Service',
'Assyrian International News Agency',
'Athens News Agency',
'Athens News Agency-Macedonian Press Agency',
'Australian Associated Press',
'Austria Presse Agentur',
'Azad News Agency',
'Azerbaijan Press Agency',
'Azerbaijan State Telegraph Agency',
'Bahrain News Agency',
'Bakhtar News Agency',
'Baltic News Service',
'Bangladesh Sangbad Shangstha',
'Bay City News',
'Belarusian Telegraph Agency',
'Belga',
'Belga',
'BelTA',
'Bernama',
'Bhartiya Broadcast',
'Bloomberg',
'Bloomberg L.P.',
'Bloomberg News',
'BNO News',
'BreakingNewsOn',
'Bulgarian News Agency',
'Bulgarian Telegraph Agency',
'Business Wire',
'Canadian Press',
'Canadian University Press',
'Capital News Service',
'Catholic News Service',
'(CCTV)',
'Center for Public Integrity',
'Central News Agency',
'Chechenpress',
'Children\'s Express',
'China News Service',
'C<NAME>',
'Cihan News Agency',
'Cision',
'CNW Group',
'College Press Service',
'Courthouse News Service',
'Croatian News Agency',
'CSRWire',
'CSRWire Canada',
'Cyprus News Agency',
'Czech News Agency',
'Deca-press',
'Defacto.am',
'Deutsche Presse-Agentur',
'Dispatch News Desk',
'Dispatch News Service',
'<NAME>',
'Dow Jones Newswires',
'(dpa)',
'EcoWin',
'Ehlas News Agency',
'Emirates News Agency',
'Environment and Energy Publishing',
'Environment News Service',
'Ethiopian News Agency',
'European News Agency Belgium',
'European Pressphoto Agency',
'Extel',
'Fars News Agency',
'Ferghana Information Agency',
'Fourth Estate',
'German News',
'GermNews',
'GiraEnLaRed',
'Global Information Network',
'GlobeNewswire',
'Gongwer News Service',
'Guerrilla News Network',
'Hacktivist News Service',
'Hetq Online',
'Hugin',
'IES News Service',
'Ihlas Haber Ajansi',
'Ihlas News Agency',
'Independent Media Center',
'Independent Network News',
'Indo-Asian News Service',
'Indybay',
'Indymedia',
'Information Technology News Agency',
'Information Telegraph Agency of Russia',
'Integrated Regional Information Networks',
'Inter Press Service',
'Inter Press Service',
'Interfax',
'International Islamic News Agency',
'International News Service',
'International Press Telecommunications Council',
'Iran Cultural Heritage', 
'Handcrafts and Tourism Organization',
'Iran Pas News Agency',
'IranDokht','Iranian Agriculture News Agency',
'Iranian Labour News Agency',
'Iranian Students\' News Agency',
'Islamic Consultative Assembly News Agency',
'Islamic Republic News Agency',
'Islamic Republic of Iran Broadcasting',
'Italian Journalist Agency',
'ITAR-Tass',
'Japan Corporate News Network',
'Jewish Telegraphic Agency',
'Jiji Press',
'Kavkaz Center',
'Kenya News Agency',
'KIpress News Agency',
'Korea Newswire',
'Korean Central News Agency',
'Kosovo\'s News Agency',
'Kyodo News',
'Lao News Agency',
'Liberation News Service',
'Lipper','Lusa News Agency',
'Macauhub',
'Macedonian Press Agency',
'Maghreb Arab Press',
'<NAME>',
'Maine Video Activists Network',
'Makfax',
'Malaysian National News Agency',
'Mehr News Agency',
'Middle East Research and Information Project',
'Mizzima News',
'Moldpres',
'Montena informativna agencija',
'NAM News Network',
'Namibia Press Agency',
'National Election Pool',
'National Iraqi News Agency',
'New Colombia News Agency',
'New Zealand Press Association',
'Newratings',
'News Agency of Nigeria',
'News Agency of the Slovak Republic',
'News Network International',
'Non-Aligned News Agencies Pool',
'Norsk Telegrambyrå',
'Norwegian News Agency',
'Notimex',
'NurPhoto Agency',
'Online International News Network',
'OpEdNews',
'Organization of Asia-Pacific News Agencies',
'Pacific News Service',
'Pacnews',
'Pakistan Press International',
'PanARMENIAN.Net',
'Petra',
'Peyamner News Agency',
'Philippine News Agency',
'PlusNews',
'Polish Press Agency',
'Polish Telegraphic Agency',
'Polska Agencja Prasowa',
'Polska Agencja Telegraficzna',
'Portuguese News Agency',
'Power and Interest News Report',
'PR Newswire',
'PR Web',
'Prensa Latina',
'Press Association',
'Press Trust of India',
'Pressclub Information Agency',
'Pupils Association News Agency',
'Qatar News Agency',
'Rasa News Agency',
'Relaxnews',
'Reuters',
'Reuters Market Data System',
'RIA Novosti',
'Ritzau',
'<NAME>',
'Rmds',
'<NAME>',
'Romanian Press Agency',
'<NAME>',
'Ruptly',
'Russian Information Agency',
'Russian News Agency TASS',
'Saba News Agency',
'<NAME>',
'Sapa',
'Saudi Press Agency',
'Schweizerische Depeschenagentur',
'Sipa USA',
'Slovenian Press Agency',
'South African Press Association',
'<NAME>',
'Syrian Arab News Agency',
'T[eé]lam',
'Tahitipresse',
'TAK-Cyprus',
'Tanjug',
'Telegraph Agency of the Soviet Union',
'Telenoticiosa Americana',
'The Canadian Press',
'The Real News',
'Tidningarnas Telegrambyr[aå]',
'Tidningarnas Telegrambyrå',
'Times Of India',
'Trust of India',
'Turkish News Agency-Cyprus',
'Turkmenistan State News Agency',
'Ukrainian Independent Information Agency',
'United Media',
'United News of Bangladesh',
'United News of India',
'United Press',
'United Press International',
'Via News Agency',
'Vietnam News Agency',
'Voice of Korea',
'Wales and West News & Sport',
'Wion Tv',
'World Entertainment News Network',
'World Student Press Agency',
'Xinhua News Agency',
'Yemen News Agency',
'Yonhap',
'Yonhap News Agency',
'Zee News',
'Zenit News Agency',
'ZUMA Press']
print('Number of Files Start : ',len(fileList))
for filename in fileList:
    f = open('.'+filename, 'r')  # #replace the . with your article directory
    fileContent = f.read()
    if [ele for ele in foreignList if(ele in fileContent)]:
        f.close()
        os.remove('.'+filename)   ##replace the . with your article directory
        print('DELETED ARTICLE : ', filename)
    else:
        f.close()
fileList = os.listdir('.')   # replace the . with your article directory
print('Number of Files End : ',len(fileList))
#replace the . with your article directory # #replace the . with your article directory ##replace the . with your article directory # replace the . with your article directory