Last active
September 27, 2025 03:19
-
-
Save cyb3rsalih/238117f458ecdcd92e2d310655d6e965 to your computer and use it in GitHub Desktop.
Revisions
-
cyb3rsalih revised this gist
Sep 27, 2025 . 1 changed file with 86 additions and 76 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,94 +1,93 @@ # Example usage python3 gaste.py "23 Nisan 1935" import concurrent.futures import sys import urllib.parse import requests gazeteler = [ "aksam", "acik%20soz", "anadolu", "aravelk", "aydin", "beyoglu", "borsa", "bugun(siyasi,iktisadi,ictimai,gundelik%20gazete)/bugun(siyasi,iktisadi,ictimai,gundelik%20gazete)", "cumhuriyet", "dogu", "en%20son%20dakika", "en%20son%20havadis", "haber(aksam%20postasi)", "hakikat", "hakimiyeti%20milliye", "hakkin%20sesi", "halkin%20dili", "halkin%20sesi", "ikdam%20(halk%20gazetesi)", "ikdam(cumhuriyet%20icin,%20halk%20icin)", "ikdam(sabah%20postasi)", "izmir%20postasi", "jamanak", "kurun", "milliyet", "munakasa", "piyasa%20cetveli", "savas", "son%20dakika", "son%20posta", "son%20telgraf", "son%20saat", "tan", "tasviri%20efkar", "turk%20sozu", "turk%20dili", "turkische%20post", "ulus", "ulus%20sesi", "ulusal%20birlik", "vakit", "vatan", "yarin", "yeni%20asir", "yeni%20mersin", "yeni%20sabah", "yenigun", "yeniyol" ] # Mapping of Turkish month names to their lowercase values for URL turkish_months = { "Ocak": "ocak", "Şubat": "subat", "Mart": "mart", "Nisan": "nisan", "Mayıs": "mayis", "Haziran": "haziran", "Temmuz": "temmuz", "Ağustos": "agustos", "Eylül": "eylul", "Ekim": "ekim", "Kasım": "kasim", "Aralık": "aralik", } # https://nek.istanbul.edu.tr/ekos/GAZETE/izmir%20postasi/izmir%20postasi_1934/izmir%20postasi_1934_temmuz_/izmir%20postasi_1934_temmuz_2_.pdf def parse_turkish_date(date_str): day, month_name, year = date_str.split() month_lower = turkish_months.get(month_name) if not month_lower: raise ValueError(f"Invalid Turkish month name: {month_name}") return { 'day': int(day), 'month': month_lower, 'year': year } def get_date(): @@ -103,13 +102,23 @@ def get_date(): def fetch_gazete(gazete): # URL encode the newspaper name to handle spaces gazete_encoded = urllib.parse.quote(gazete) # Build the new URL format url = f"https://nek.istanbul.edu.tr/ekos/GAZETE/{gazete_encoded}//{gazete_encoded}_{tarih['year']}/{gazete_encoded}_{tarih['year']}_{tarih['month']}_/{gazete_encoded}_{tarih['year']}_{tarih['month']}_{tarih['day']}_.pdf" r = requests.head(url, timeout=3) print(r) if r.status_code == 200: print(url) else: # Optional: print failed attempts forçç√ debugging # print(f"Failed to fetch {gazete}: {r.status_code}") pass # Adjust the number of threads in the pool @@ -119,3 +128,4 @@ def fetch_gazete(gazete): executor.map(fetch_gazete, gazeteler) print("Bitti") -
cyb3rsalih revised this gist
Dec 30, 2023 . 1 changed file with 96 additions and 58 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,76 +1,114 @@ # Example usage python3 gazete.py "23 Mayıs 1954" import concurrent.futures import sys import requests gazeteler = [ "agac", "ahali_filibe", "akis", "aksam", "anadolu", "aydede", "balkan_filibe", "birgun", "bugun_2005", "bugun", "buyuk_dogu", "commodore", "cumhuriyet", "diyojen", "haber", "hakimiyeti_milliye", "halkin_sesi", "hayat", "her_ay", "ikaz", "ikdam_sabah_postasi", "iradei_milliye_sivas", "kadro", "kurun", "milli_gazete", "milliyet", "peyam", "radikal", "sebilurresad", "serbes_cumhuriyet", "servet", "serveti_funun", "servetifunun_uyanis", "son_posta", "son_telgraf", "sozcu", "takvimi_vekayi", "tan", "tanin_yeni", "tanin", "taraf", "tasviri_efkar", "turk_dili", "ulus", "ulusal_birlik_izmir", "vakit", "vatan", "yarın", "yarim_ay", "yeni_asir", "yeni_istanbul", "yeni_sabah", "yeni_safak", "yenigun_antakya", "zafer", "zaman", "zaman_feza", ] # Mapping of Turkish month names to their numeric values turkish_months = { "Ocak": 1, "Şubat": 2, "Mart": 3, "Nisan": 4, "Mayıs": 5, "Haziran": 6, "Temmuz": 7, "Ağustos": 8, "Eylül": 9, "Ekim": 10, "Kasım": 11, "Aralık": 12, } def parse_turkish_date(date_str): day, month_name, year = date_str.split() month = turkish_months.get(month_name) if not month: raise ValueError(f"Invalid Turkish month name: {month_name}") return f"{year}-{month:02d}-{int(day):02d}" def get_date(): if len(sys.argv) > 1: return parse_turkish_date(sys.argv[1]) else: return parse_turkish_date(input("Gün Ay Yıl şeklinde tarih giriniz: ")) # Using the function tarih = get_date() def fetch_gazete(gazete): url = f"https://www.gastearsivi.com/gazete/{gazete}/{tarih}/1" r = requests.get(url) if r.status_code == 200: print( # f"{gazete} gazetesi {tarih} tarihli sayısı bulundu.\n==> https://www.gastearsivi.com/gazete/{gazete}/{tarih}/1\n\n" f"https://www.gastearsivi.com/gazete/{gazete}/{tarih}/1" ) -
cyb3rsalih revised this gist
Dec 26, 2023 . 1 changed file with 56 additions and 58 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,64 +3,62 @@ import requests gazeteler = [ "agac", "ahali_filibe", "akis", "aksam", "anadolu", "aydede", "balkan_filibe", "birgun", "bugun_2005", "bugun", "buyuk_dogu", "commodore", "cumhuriyet", "diyojen", "haber", "hakimiyeti_milliye", "halkin_sesi", "hayat", "her_ay", "ikaz", "ikdam_sabah_postasi", "iradei_milliye_sivas", "kadro", "kurun", "milli_gazete", "milliyet", "peyam", "radikal", "sebilurresad", "serbes_cumhuriyet", "servet", "serveti_funun", "servetifunun_uyanis", "son_posta", "son_telgraf", "sozcu", "takvimi_vekayi", "tan", "tanin_yeni", "tanin", "taraf", "tasviri_efkar", "turk_dili", "ulus", "ulusal_birlik_izmir", "vakit", "vatan", "yarın", "yarim_ay", "yeni_asir", "yeni_istanbul", "yeni_sabah", "yeni_safak", "yenigun_antakya", "zafer", "zaman", ] -
cyb3rsalih created this gist
Dec 26, 2023 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,85 @@ import concurrent.futures import requests gazeteler = [ "agac", "cumhuriyet", "yeni_safak", "zafer", "zaman", "yeni_sabah", "yeni_istanbul", "yenigun_antakya", "yeni_asir", "vakit", "vatan", "yarim_ay", "yarın", "ulusal_birlik_izmir", "ulus", "turk_dili", "tanin", "tanin_yeni", "taraf", "tasviri_efkar", "tan", "takvimi_vekayi", "sozcu", "son_telgraf", "servet", "serveti_funun", "servetifunun_uyanis", "son_posta", "serbes_cumhuriyet", "sebilurresad", "radikal", "peyam", "milliyet", "milli_gazete", "kurun", "ikaz", "ikdam_sabah_postasi", "iradei_milliye_sivas", "kadro", "her_ay", "hayat", "halkin_sesi", "hakimiyeti_milliye", "commodore", "cumhuriyet", "diyojen", "haber", "buyuk_dogu", "bugun_2005", "bugun", "birgun", "balkan_filibe", "aydede", "anadolu", "aksam", "akis", "ahali_filibe", "agac", ] tarih = input("YYYY-AA-GG Tipinde Tarih giriniz: ") def fetch_gazete(gazete): url = f"https://www.gastearsivi.com/gazete/{gazete}/{tarih}/1" r = requests.get(url) if r.status_code == 200: print( f"{gazete} gazetesi {tarih} tarihli sayısı bulundu.\n==> https://www.gastearsivi.com/gazete/{gazete}/{tarih}/1\n\n" ) # Adjust the number of threads in the pool pool_size = 10 with concurrent.futures.ThreadPoolExecutor(max_workers=pool_size) as executor: executor.map(fetch_gazete, gazeteler) print("Bitti")