From 336f2db7ecd3fb88d99915e18faddf5a7984b479 Mon Sep 17 00:00:00 2001 From: the-REAL-beautysleep Date: Tue, 27 Sep 2022 16:47:00 +0100 Subject: [PATCH 1/3] test upload of drop_dead_urls --- hooks/pre-commit | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index f1f43bd9..58c55420 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -4,34 +4,64 @@ from __future__ import print_function import os import sys +import requests -def extract_names(f_name): - with open(f_name, 'r') as f: + +def extract_names(file_name): + with open(file_name, 'r') as f: for line in f: # Probably should look for -\S+[A-Za-z\S]+ instead if line.startswith('- '): yield line.split(' ', 1)[1] + def strip_url(s): return " ".join(s.strip().split(' ')[:-1]) + +def return_url(s): + return s.strip().split(' ')[-1] + + +def check_line_for_reachable_url(line, file): + if line.startswith('- '): + url = return_url(line) + get = requests.get(url) + # if the request succeeds + if get.status_code == 200: + file.write(line) + else: + file.write(line) + + +def drop_dead_urls(): + for file_name in ['README.md', 'github.md']: + with open(file_name, "r") as f: + lines = f.readlines() + with open(file_name, "w") as f: + for line in lines: + check_line_for_reachable_url(line, f) + + def validate_ordering(): ret_val = 0 - for f_name in ['README.md', 'github.md']: - if not os.path.exists(f_name): - print(' [-] Aborting commit: expecting %s to exist'%f_name) + for file_name in ['README.md', 'github.md']: + if not os.path.exists(file_name): + print(' [-] Aborting commit: expecting %s to exist'%file_name) ret_val = 1 else: - print(' [+] Checking %s'%f_name) + print(' [+] Checking %s'%file_name) prev_line = None - for line in extract_names(f_name): + for line in extract_names(file_name): if prev_line is not None and line.lower() < prev_line.lower(): print(" [-] Aborting commit: %s and %s are out of order!"%( strip_url(line), strip_url(prev_line))) ret_val = 1 prev_line = line + drop_dead_urls() return ret_val + if __name__ == '__main__': sys.exit(validate_ordering()) From 5da7977a30514191a5549da8c079c662f291bb8a Mon Sep 17 00:00:00 2001 From: the-REAL-beautysleep Date: Wed, 28 Sep 2022 10:27:28 +0100 Subject: [PATCH 2/3] works on the cmd --- github.md | 2 +- hooks/pre-commit | 39 ++++++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/github.md b/github.md index d8083c55..b5f3d91d 100644 --- a/github.md +++ b/github.md @@ -919,4 +919,4 @@ Hackathon Hackers' GitHub profiles - Zakariyya Mughal https://github.com/zmughal - Zane Blackwell Sterling https://github.com/Shriken - Zhou Yi https://github.com/ZhouYii -- 서태웅 (Justice Suh) https://github.com/justicesuh +- 서태웅 (Justice Suh) https://github.com/justicesuh \ No newline at end of file diff --git a/hooks/pre-commit b/hooks/pre-commit index 58c55420..829a9033 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -4,6 +4,7 @@ from __future__ import print_function import os import sys +import re import requests @@ -20,28 +21,40 @@ def strip_url(s): def return_url(s): - return s.strip().split(' ')[-1] + url = s.strip().split(' ')[-1] + if url.startswith('http'): + return url + elif url.startswith('['): + url = re.search('\[(.+?)\]', url) + if url: + return url.group(1) + else: + return 'http://' + url def check_line_for_reachable_url(line, file): if line.startswith('- '): url = return_url(line) - get = requests.get(url) - # if the request succeeds - if get.status_code == 200: - file.write(line) + try: + get = requests.get(url, timeout=5) + if get.status_code == 200: + print(line) + file.write(line) + except Exception as e: + print(e) else: file.write(line) - + print(line) + def drop_dead_urls(): - for file_name in ['README.md', 'github.md']: - with open(file_name, "r") as f: - lines = f.readlines() - with open(file_name, "w") as f: - for line in lines: - check_line_for_reachable_url(line, f) - + with open('README.md', "r") as f: + lines = f.readlines() + with open('README.md', "w") as f: + # multiprocessing? + for line in lines: + check_line_for_reachable_url(line, f) + def validate_ordering(): ret_val = 0 From 2b454cfec0f29b29271db2de6c0c47d3fb4ff9d3 Mon Sep 17 00:00:00 2001 From: the-REAL-beautysleep Date: Wed, 28 Sep 2022 13:39:30 +0100 Subject: [PATCH 3/3] would have preferred if drop_dead_urls.py ran as part of the precommit but this will do for now --- README.md | 227 +--------------------------------------------- drop_dead_urls.py | 42 +++++++++ hooks/pre-commit | 42 +-------- 3 files changed, 44 insertions(+), 267 deletions(-) create mode 100644 drop_dead_urls.py diff --git a/README.md b/README.md index 46bf8e10..247ac875 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,13 @@ Sorted alphabetically by first name. To add yours, please see [the contributing If you'd like to see GitHub profiles, [click here](github.md). - Aakash Japi http://aakashjapi.com/ -- Aamir Ahmad http://aamirahmad.me/ - Aashni Shah http://aashni.me - Aaron Dancer http://aarondancer.com - Aaron Gunderson http://www.agundy.com - Aayush Ranaut http://aayush.net -- Abhinav Kurada http://akurada.tech -- Abhinav Rajaseshan http://abhiseshan.me - Abhinav Sharma http://excode.me -- Abhishek Sharma http://abhisheksharma.design - Abinav Seelan [http://abinavseelan.com](http://abinavseelan.com?utm_source=hackathonHackersGithub) - Abody Aljoudi https://chrismatic.io/ -- Achal Varma http://acha.lv/ -- Acho Arnold http://acho.arnold.cf/ - Adam Circle https://www.adamcircle.com - Adam Hamot http://zamn.net - Adam McNeilly http://adammcneilly.com @@ -30,25 +24,18 @@ If you'd like to see GitHub profiles, [click here](github.md). - Afonso Praça http://afonsopraca.com.br/ - Ai Onda http://aicecream.com - AJ Norton http://ajnorton.com/ -- Ajay Jain https://initajay.me - Ajay Singh https://about.me/ajay-s - Ajit Pawar http://pawar.ca/ - Akash Patel http://akashp.co -- [Akash Tandon](http://github.com/analyticalmonk) http://akashtandon.com - Akhilesh Yarabarla http://yarabarla.com - Akshay Dixit http://akshaydixi.me - Akul Mehra http://akul.me/ -- Alaina Kafkes http://alainakafk.es - Alan Chen http://alanchen.co - Albert Untung http://albert.wtf - Alberto Villalobos http://albertovillalobos.me/ -- Alec Robins http://www.alecrobins.me/ - Alejandro Rioja http://alejandrorioja.com -- Alex Cory http://alexcory.com -- Alex Johnson https://www.alex-johnson.net/ - Alex Koshy http://koshy.co/ - Alex Strong http://alexfortis.github.io/ -- Alex Wang http://alw231.github.io - Alexander Maru http://alexandermaru.com - Alexander Mistakidis http://aamistak.me - Ali Karpuzoglu https://alikarpuzoglu.com @@ -62,9 +49,6 @@ If you'd like to see GitHub profiles, [click here](github.md). - Amrit Singh http://singhamrit.me - Anantha Natarajan S http://ananth.co.in - Anat Gilboa http://anat.me -- Andras Varga http://avarga.me -- Andreas Limberopoulos http://www.limbera.com.au -- Andrew Breckenridge http://andrewsb.me - Andrew Cui http://andrewcui.com - Andrew Dai http://www.andrewdai.co - Andrew Drozdov http://www.mrdrozdov.com @@ -73,51 +57,28 @@ If you'd like to see GitHub profiles, [click here](github.md). - Andrew Levandoski http://www.andrewlevandoski.com/ - Andrew Page https://www.andrewpage.me - Andrew Q Tran http://andrewqtran.com -- Andrew Tam http://ahndrewtam.me -- Andrew Yang http://andrewyang.xyz/ - Andy Chen https://amazingandyyy.github.io/ - Andy Kamath http://andykamath.com -- Andrew Wong http://andrewwong.xyz/ -- Andy Wong http://andy-wong.ca - Aneesh Ashutosh http://aneeshashutosh.com/ - Anirudh Goel http://anirudhgoel.me -- Anirudh Veeraragavan https://aniveera.com/ -- Ankit Agrawal http://ankitmaverick.com - Ankit Sardesai http://ankitsardesai.ca/ - Ankit Shah https://ankitshah009.github.io/ - Ankit Sultana http://ankitsultana.com - Anthony Sistilli http://anthonysistilli.me -- Anton Relin http://arelin.me - Antonio Marino http://antoniomarino.me - Anuraag Yachamaneni http://anuraag.me - Anurag Aryan http://anuragaryan.com - Anurag Banerjee http://anuragbanerjee.me -- Anurag Dubey http://anuragdubey.tech - Anurag El Dorado http://aedorado.github.io/ - Anya Tran http://anyatran.com - Aparajithan Venkateswaran http://aparav.github.io/ -- Ari VanIderstine http://ariari.io - Arin Ray http://arinray.me - Arjun Bhatnagar http://arjunb.com -- Arjun Sarode http://asarode.github.io/ -- Arka Ganguli http://arkaganguli.ca/ -- Arnaud Schenk http://arnaudschenk.me -- Arnav Garg http://arnavgarg.me -- Arush Shankar http://arush.me - Asaph Yuan http://asaphyuan.com - Asheer Tanveer http://asheertanveer.com -- Ashish Kedia https://ashishkedia.me - Ashris Choudhury http://iashris.com -- Ashok Koduru https://ashokkoduru.com -- Ashpan Raskar http://ashpanraskar.com -- Ashutosh Kumar https://ashutoshanand.com -- Ashwin Kachhara http://ashwinkachhara.com -- Athul Atom Vayalinkal http://vayalinkal.com - Aury Bwashi http://aurybwashi.me -- Austin L. Chang http://www.austinlchang.com - Austin Liu http://aliu139.github.io/ -- Avi Kejariwal http://www.avikejariwal.com -- Avijeet Gupta http://avijeetgupta.me/ - Avijeet Sachdev http://avijeets.com - Ayush Singh http://ayush1997.github.io - Banghua Zhao http://banghuazhao.com/ @@ -127,121 +88,67 @@ If you'd like to see GitHub profiles, [click here](github.md). - Ben Weinstein-Raun http://www.benwr.net - Ben Williams http://719Ben.com - Bernice Go http://bernicewygo.github.io -- Berwin Xie http://berwin.io - Bilal Majeed http://bilalmajeed.com - Bill Guo http://billguocheng.com - Bo Pace http://bopace.com - Brandon Amos http://bamos.github.io - Brandon Davis http://subdavis.com -- Brandon Truong http://hello.brandontruong.com - Brendan Ryan http://brendanjryan.com/ - Brent Bovenzi http://bbovenzi.com/ - Brian Chu www.brianchu.com - Brian Chuk http://devchuk.github.io/ - Brijesh Patel https://about.me/brijeshpatel9 -- Britt Mathis http://bmuk.io -- Bruno B. Ferrari Faviero http://brunofaviero.com -- Bryan Garza http://bryangarza.me -- Caitlin McDonald http://www.caitlinamcdonald.com -- Camille Considine http://www.camilleconsidine.com - Campion Fellin http://campionfellin.com -- Caroline Hermans http://carolinehermans.com -- Cary Anderson www.cary.guru - Cassidy Williams http://cassidoo.co - Chaitanya Bapat https://chaibapchya.github.io - Chaitanya Joshi http://chaitanyajoshi.xyz - Chandramowli J https://chamow97.github.io/ -- Chaoyi Zha http://cydrobolt.com - Charles Ma https://charlesma4.github.io/ -- Charlie Kingston http://charliekingston.co.uk - Charmaine Lee http://www.charmaineklee.com/ -- Cheng Peng http://www.chengpeng.ca -- Chetan Badhe http://chetanbadhe.me - Chetanya Kandhari http://availchet.github.io/ -- Chinmaya Kr. Patanaik https://pattu777.github.io -- Chirag Aggarwal http://www.chi6rag.net - Chirag Chauhan http://chiragchauhan.com -- Chris Bolton http://codeandconfusion.com/ -- Chris Lai http://chrislai.info -- Chris Lee http://collegefill.com -- Christian Barcenas http://www.cbarcenas.com/ - Christina Platt http://christinaplatt.weebly.com - Christopher Ngo http://ingochris.tech - Christopher Scott http://scottdchris.com -- Christopher Smith http://cvsmith.me - Christopher Su http://christopher.su - Cindy Yu http://cindyyu.com -- Clayton Brand http://claytonbrand.com -- Colin Mcillece http://cmacca.github.io -- Connor Smith http://www.connor-a-smith.com -- Cosi Leone http://cosileone.com/ -- Cyrus Roshan http://cyrusroshan.me -- Dakota St. Laurent http://stdako.com -- Dan Appel https://dvappel.me -- Dan Fujita http://danfujita.com -- Dan Landy http://www.danlandy.com -- Dan Ni http://danielni.me - Dan Schlosser http://danrs.ch - Dan Zhang www.danzhang.net - Dana Lee http://danagilliann.me/ - Daniel Barychev http://www.danbarychev.com - Daniel C. Eckert http://drakontas.org - Daniel Hsing https://arthelon.github.io -- Daniyar Yeralin http://yeralin.net -- Danya Baron http://www.danyabaron.com/ - Darion Cassel http://darioncassel.me -- Darren Gilbert http://darrengilbert.rocks - Darren Tu http://darrentu.github.io -- Darshan Sharma https://www.darshansharma.me -- Dave Scott McCarthy https://aslittledesign.com -- Dave Fontenot http://davefont.com - David Awad http://davidawad.github.io -- David BasedMathematician Coven http://davidcoven.me - David da Silva http://dasilvacont.in -- David Mattia http://www.david-mattia.com -- David Meza http://www.davidmeza.us - Deepak Pathania http://deepakpathania.github.io - Derek Hua http://derekhua.me - Devin Soni http://100.github.io/ -- Dhiraj Bodicherla http://dhiraj.me - Dhruv Arora http://arora.io - Dhruv Ramani https://dhruvramani.github.io/ - Diana Chang http://DChang87.github.io -- Diana Zink http://doerhub.com/of/diana - Dilpreet Chana http://dschana.com/ - Diogo Capela http://diogocapela.com - Dima Konev http://ezhik.me - Dima Vishnevetsky http://www.dimshik.com - Dominic Dabish http://www.dominicdabish.com/ -- Dylan McIntyre http://dmcintyre.net -- Elad Keyshawn http://eladkeyshawn.tk/ - Eli White http://eli-white.com - Elisha Lai https://elailai94.surge.sh - Elissa Shevinsky http://elissashevinsky.com -- Eric Bachmeier http://ericbachmeier5.github.io - Eric Lee http://thecreedo.github.io - Eric Song http://ericsong.io - Eric Zinnikas https://ericz.com -- Ethan Richardson http://richardsonethan.me - Eugene Cheung www.echeung.me -- Ezekiel Kigbo http://eakigbo.me - Ezequiel França http://ezefranca.com -- Fahad Ahmad http://www.fahadahmad.me -- Faiz Ahmad http://faiz.io -- Fan Zhang http://thefanzhang.com - Fisher Adelakin http://fisheradelakin.com/ -- Fletcher Richman http://fletcher.io - Frank Cash http://hackerqueue.herokuapp.com - Freddie Vargus https://freddiev4.github.io -- Gagan Deep http://www.gagandeep.me/ - Gagik Movsisyan http://gagikm.com -- Ganesh Swamypillai http://iotenthu.com - Gangeshwar Krishnamurthy http://gangeshwark.com/ - Gary-Yau Chan http://garyyauchan.com -- Gautam Mittal http://www.gautam.cc - Gautham Santhosh https://gauthamzz.github.io - George Lee http://georgel.ee -- Gibran Garcia http://gibrangarcia.me - Gordon Zheng http://gordn.org/ - Gourav Suri https://thegenuinegourav.github.io/ - Grant Park http://www.grant.ai @@ -249,20 +156,13 @@ If you'd like to see GitHub profiles, [click here](github.md). - Greyson Parrelli http://greysonparrelli.com - Guilherme Berger http://gberger.me - Gur Raunaq Singh http://raunaq.me -- Gurnoor Singh https://gurnoorsingh.com - Gyan Lakhwani http://gyanl.com -- Hamza Khan https://hamzakhan.org - Harris Christiansen http://harrischristiansen.com -- Harry Gogonis http://hgogonis.me -- Harsh Vardhan http://royalharsh.github.io - Harshay Shah http://harshay.me -- Harshit Budhraja http://harshitbudhraja.snustudents.in - Harvey Chan http://harveychan.net/ - Hassan Nadeem http://HassanNadeem.com -- Hayden Lee http://haydenlee.io/ - Henry Millison http://henrymillison.com - Hiten Sharma http://htadg.github.io/ -- Hitesh kaushik http://hiteshkaushik28.github.io - Hugh Rawlinson http://hughrawlinson.me/ - Hunter Larco http://larcolabs.com - Hussain Abbas http://hussainabbas.com @@ -271,57 +171,39 @@ If you'd like to see GitHub profiles, [click here](github.md). - Ian Macalinao http://ian.pw - Ian Webster http://www.ianww.com - Ibrahim Ahmed http://iahmed.me -- Ignacio Alonso http://ignacioalonso.me - Iheanyi Ekechukwu http://iheanyi.com - Isaac Addis https://isaacaddis.github.io/ - Isaac Gluck http://isaacgluck.com - Ismael Rodriguez http://ismaelrh.com -- Jack Fischer http://jackfischer.me -- Jack Korbin www.lykpic.com -- Jack Lamberti http://jacklamberti.com -- Jack McGrath http://handsome.rocks - Jack Wearden https://www.jackwearden.co.uk - Jacob Jenkins http://jacobejenkins.com - Jairam Patel http://jairampatel.com/ - James Billingham http://jamesbillingham.com - James Kao http://jameskao.me - James Liu https://jamesliu.ca -- James Vyas http://jimivyas.me - Jamone Kelly http://jamonek.com/ - Jason Du http://dujason.com/ - Jason Liu http://jxnl.co - Jason Park http://jasonpark.me - Javier Taylor http://javiertaylor.com -- Jaxon Stevens www.jaxonstevens.com - Jay Kamat http://jgkamat.github.io -- Jay Mo http://jaymo.me/ - Jaylen Wimbish http://www.jaylenwimbish.com/ -- Jeffrey Lin http://linjeffrey.me -- Jennifer Apacible http://apacible.us/ - Jennifer Tran https://jennifertran.github.io/ - Jeremiah Parrack https://jeremiahlukus.github.io - Jeremy Cantu https://jac21.github.io/ -- Jeremy Meyer http://jeremymeyer.us - Jerica Huang http://jericahuang.com - Jerrick Davis http://jerrick.us - Jess DeJong https://jessdejong.github.io - Jesse Chand http://jessechand.com -- Jesse Collins http://jtcollins.me - Jessica Chang http://jessmchang.com - Jevin Sidhu http://jevinsidhu.com - Jia Wei http://jiaw.me - Jian Wei Chuah http://jianweichuah.com -- Jing Xiao http://www.notajingoist.com/index.html - Joe Duncko http://joeduncko.com/ - Jonathan Almeida http://jonalmeida.com -- Jonny Krysh http://www.jonnykrysh.me - Jordan Arnesen www.byjor.com - Joseph Khawly http://josephkhawly.com/ - Joseph Milla https://josephmilla.com/ -- Joseph Pena https://josephpena.me/ -- Josh Snider https://www.joshuasnider.com/ -- Josica Ganesamurthy http://www.josica.me -- Joshua Cockrell http://joshuakcockrell.com/ - Joshua Raichur http://joshuaraichur.com/ - Juan Chomali http://jchomali.com - Junhson Jean-Baptiste http://junhsonjb.com/ @@ -330,19 +212,11 @@ If you'd like to see GitHub profiles, [click here](github.md). - Justin Bleuel http://justinbleuel.github.io - Justin Borromeo http://justinborromeo.github.io - Justin Cano http://jcano.me -- Justin Chan http://justinthec.me - Justin Kuang http://justinkuang.com - Justin Paulin http://justinpaulin.com - Justin Yang http://y4ng.com - Kamesh Vedula http://kameshvedula.com -- Karan Goel http://www.goel.im -- Karan Shah www.karanprime.com -- Karan Sharma http://karansh.me/ -- Karel Vuong http://karel.ca - Karthikeyan NG http://www.intrepidkarthi.com -- Kaustav Haldar http://kaustavha.github.com -- Keaton Okkonen http://keatco.de -- Kenneth Schnall https://kensch.com - Keon Kim http://keon.io - Kevin Beaulieu http://www.kevinmbeaulieu.com - Kevin Frans http://www.kevinfrans.com @@ -352,86 +226,50 @@ If you'd like to see GitHub profiles, [click here](github.md). - Kevin Payravi http://www.kevinpayravi.com/ - Kevin Pei http://kevinpei.com - Kevin Yeh http://kyeh.me -- Kevin Zhang https://blog.kevinzhang.me -- Kilim Choi http://kilimchoi.com -- Kirby Kohlmorgen http://kirbyk.me -- Kirsten Rauffer http://www.kirstenrauffer.com - Krish Dholakiya http://itskrish.co - Krish Munot http://krishmunot.github.io/ - Krishn Ramesh http://krishn.me -- Kristian Sooklal http://kristiansooklal.me -- Kumar Anirudha http://anirudha.org - Kyle Frost http://kylefrost.me - Kyle Johnson http://kylejson.com -- Larry Boateng Asante http://larryasante.xyz - Laurence Welch http://laurencewelch.com - Lawrence Lin Murata http://lawrencemurata.com/ -- Lex Alexander http://coderlex.com -- Li Xuanji http://xuanji.li - Liam Horne http://lihorne.com - Liam Rahav http://liamrahav.me - Liang Gao http://liang.gao.nyc - Lilas Dinh http://www.hatfolk.com - Long Tran http://ltran.co -- Lovekesh Garg http://iamvoid13.github.io -- Luka Marr http://lukamarr.github.io - Mahir Kothary http://mahirk.com -- Manash Mandal http://mandal.manash.me/ - Manoj Nathwani http://manoj.ninja -- Manoj Pandey http://manojpandey.me - Manraj Singh http://manrajsingh.in - Marco Bettiolo http://bettiolo.it -- Maria Chavez http://mariachavez.co -- Mark Diez http://markediez.me -- Mark Ormesher https://www.markormesher.co.uk/ -- Markan Patel http://markanpatel.me -- Marko Jovanovic http://fr1sk.github.io/ - Martin Petkov http://www.martinpetkov.me/ -- Masoud Harati https://masoudh.ml -- Matheus C. Candido http://cassiano.me - Matisse B. VerDuyn http://matisseverduyn.com/ -- Matt Chan http://themattchan.com/ -- Matt Condon http://matt.cond.in -- Matthew Allen http://matthewallen.xyz/ - Matthew Bell https://mbell.me/ - Matthew Bentley https://bentley.link/ -- Matthew Bucci http://matthewbucci.com - Matthew Kaiser http://mkaiser.io - Matthew Kaufer http://kaufer.org - Max Maybury http://maxjmay.co.uk - Max Shavrick http://mxms.pw - Meet Shah http://meetshah1995.github.io/ -- Megan Ruthven http://maruthven.com/ - Mehul Prajapati https://mehul-m-prajapati.github.io/ - Michael Borohovski http://shanewilton.com -- Michael Gonzales http://mkgo.co/ -- Michael Ho Chum http://michaelchum.com - Michael Huang http://michaelyh.com - Michael Hulet https://hulet.tech -- Michael Leung https://mileung.com -- Michael Sung-Ho Park http://devmichaelpark.com/ - Michael Zhang http://michaelz.xyz -- Milan Dasgupta http://www.milandasgupta.com - Milson Munakami http://milstein.me -- Ming Luo http://Ming-Luo.com - Minh Nguyen http://minh.io - Mitchell Gordon http://mitchgordon.me -- Mohaimin Al Aoun http://mohaiminalaoun.github.io -- Mohammed Aqeel Gaggutur http://mgaggutur.me - Mohd Maqbool Alam http://www.maqbool.net - Mohan Pawar http://mohan08p.strikingly.com/ - Monica Powell http://aboutmonica.com - Morgante Pell http://morgante.net - Moshe Berman http://mosheberman.com - Mubaris NK http://mubaris.com -- Mykayla Fernandes http://mfcecilia.co - Nakul Pathak http://nakulpathak.com -- Naman Maheshwari http://www.namanmaheshwari.com/ - Namit Juneja http://namitjuneja.com - Naomi Pentrel http://naomi.codes/ - Naresh R http://ghostwriternr.me/ - Nate Levesque http://thenaterhood.com -- Nate Owen http://nateo.co - Nathaniel Baulch-Jones http://natbj.me - Natu Myers http://natumyers.com - Naveen Shukla http://naveenshukla.github.io @@ -442,9 +280,7 @@ If you'd like to see GitHub profiles, [click here](github.md). - Nelson Gomez http://ngomez.me - Nelson Liu http://nelsonliu.me - Nicholas Brown http://kompulsa.com -- Nick Roberts https://meadowlab.io - Nick Zuber https://nickzuber.com -- Nico Hindering http://nicohinderling.me - Nikhita Raghunath https://nikhita.github.io - Nimit Kalra http://nimit.io - Niraj Pant http://niraj.io @@ -452,17 +288,10 @@ If you'd like to see GitHub profiles, [click here](github.md). - Noah Hradek http://noahhradek.me/ - Noam Hacker http://noamhacker.com/ - Noga Raviv http://nogaraviv.com -- Oindril Dutta http://odutta.com -- Ore Aleb http://oreoluwa.me/ -- Ou Ye http://ouye.ca -- Omkar Konaraddi https://konaraddio.github.io - Palash Chatterjee https://pecey.github.io - Panashe Mahachi http://pkm.me -- Pandelis Zembashis http://pandelis.me - Parth Mehrotra http://parthmehrotra.com - Pat Myron http://patmyron.com -- Patricio Córdova http://www.cs.toronto.edu/~patricio -- Patrick Tumbucon http://tumbucon.tech - Paul Krishnamurthy http://paulkr.com - Paweł Szczurko www.pawel.pw - Peter Leng http://peterleng.com/ @@ -471,23 +300,14 @@ If you'd like to see GitHub profiles, [click here](github.md). - Pradyuman Vig http://www.pradyumanvig.com - Prateek Chanda https://prateekiiest.github.io - Pranit Bauva http://www.bauva.com -- Pramesh Bajracharya http://bajracharya.me - Preston Mueller http://prestonmueller.com - Qile Wang http://aroundthelines.com/ - Quim Llimona http://lemonzi.me -- Raghav Dua http://raghavdua.com - Raghav Sood http://raghavsood.com -- Rahul Tuteja http://tutejarahul.co -- Raja Sekar http://rajasekarm.com -- Rajan Bhattarai https://www.cdrrazan.me -- Rajat Mehndiratta http://rajatmehndiratta.me - Raphael Rouvinov-Kats http://raphaelrk.com - Rashiq Ahmad http://rashiq.me -- Ravin Sardal http://ravinsardal.me -- Raviteja Lingineni http://rlingineni.me - Raymond Chung https://rchung95.github.io - Riccardo Mutschlechner http://cs.wisc.edu/~riccardo -- Richard Chu http://churichard.me/ - Richard Kraaijenhagen http://riichard.com/ - Rikin Katyal http://sirvar.com - Rishi Dhanaraj http://rishi.io @@ -498,41 +318,28 @@ If you'd like to see GitHub profiles, [click here](github.md). - Robert Olsthoorn http://robertolsthoorn.com - Robert Reinold http://www.robreinold.com - Robin van Wijngaarden http://www.robinvanwijngaarden.com/ -- Robin Wakeman http://robinwakeman.ca/ -- Rodrigo Argumedo http://rodrigoargumedo.github.io -- Roger Zou http://rogergzou.com - Rohan Likhite http://rohanlikhite.com - Rohan Varma http://rohan-varma.github.io -- Rohan Yelsangikar http://royels.me - Ron Wright http://ronwright.me - Ronak Shah http://ronakshah.net - Rootul Patel http://rootulp.com/ - Rosy Gupta http://rosygupta.github.io - Rudhra Raveendran https://rooday.com/ -- Ruiqi Mao http://www.ruiqimao.com/ - Rushi Shah http://www.rshah.io/ -- Rushy Panchal https://panchr.me - Ryan Choi http://ryanjchoi.com - Ryan D'souza http://dsouzarc.github.io - Ryan Fitzgerald https://ryanfitzgerald.ca -- Ryan Lin http://ryanlin.com - Ryan Senanayake http://www.RSenApps.com - Ryhan Hassan http://ryhan.org - Rõhith Varanasi http://rohithvaranasi.com - Sagar Garg http://sagargarg.github.io/ - Sahib Chandnani http://sahib.ch/ -- Sahibjot Saggu http://www.sahibjot.me/ - Sahil Dua http://sahildua.com -- Sai Grandhi http://grandhi.me - Saleh Hamadeh http://shamadeh.com -- Saleh Kaddoura http://tekee.herokuapp.com/ - Samay Shamdasani https://shamdasani.org - Sameer Khoja http://sameerkhoja.com - Sameer Kumar http://www.sameerkumar.website - Sanil Chawla http://sanil.co/ -- Sang Han http://sanghan.me -- Sanjeev S Nair http://www.sanjeevs.net/ -- Sankarshan Vidyadhar Mudkavi http://smudkavi.com/ - Sanyam Khurana http://www.SanyamKhurana.com - Saransh Kataria https://www.wisdomgeek.com - Saurabhkumar Marpadge https://saurabhmarpadge.github.io/ @@ -540,28 +347,19 @@ If you'd like to see GitHub profiles, [click here](github.md). - Scott Mangiapane https://scottmangiapane.com - Scott Street http://spru.sr/ - Sean Goodrich http://www.smgoodrich.com/ -- Sean Smith http://seanssmith.me - Sebastian Merz http://smerz.io - Seer O'Salomon www.christianvermeulen.net -- Selynna Sun http://selynnasun.me - Seng Zhao Too http://sztoo.github.io -- Sergio Mattei Díaz https://ftxrc.github.io - Sergio Puleri http://spuleri.com/ - Shaashwat Sharma http://shaashwat.co.nf - Shaban Samani http://shabansamani.github.io - Shafqat Dulal http://sdulal.github.io - Shail Shetye http://www.shailshetye.com/ -- Shakti Goap http://shaktigoap.in - Shameel Abdullah http://meeoh.github.io/ -- Shane DeWael http://shanedewael.com/ - Sharon Lin http://sharonlin.me - Shashank Saxena http://shashanksaxena.me/ - Shashank Shekhar http://shashankshekhar.me/ -- Sheikh Araf http://sheikharaf.me/ - Shibasis Patel http://shibasisp.github.io/ -- Shikib Mehri http://shikib.ca/ -- Shivam Sharma http://shivams334.github.io/ -- Shin Wang http://www.shinwang.us - Shruti Appiah http://shrutiappiah.github.io/ - Shubham Sawant http://moghya.me - Shy Ruparel http://ruparel.co @@ -570,13 +368,9 @@ If you'd like to see GitHub profiles, [click here](github.md). - Sophie Wang http://individual.utoronto.ca/channelSW/ - Sonny Lazuardi http://sonnylab.com - Sourabh Shetty http://sourabh.io -- Sourav Biswas https://sravb.github.io/ -- Sreetam Das http://sreetamdas.github.io - Sricharan Chiruvolu http://sricharan.xyz - Srijay Kasturi http://techfilmer.com - Srikar Gudipati http://srikarg.github.io/ -- Srinivaas Sekaran https://ssrinivaas.github.io/ -- Sriranganathan Ravi http://sriranganathan.me - Stanley Lim http://stanleylim.me/ - Stephan Boyer http://www.stephanboyer.com - Stephen Chen http://stephenc.me/ @@ -603,42 +397,27 @@ If you'd like to see GitHub profiles, [click here](github.md). - Thomas Lam http://thomaslam.github.io - Timotius Sitorus http://timsitorus.com - TJ Horner http://horner.tj/hello -- Tom Koker http://tomkoker.com - Tristan Wiley http://tristanwiley.com/ -- Tu Tran http://www.tuvtran.com -- Tushar Chopra http://chopratushar.com - Ty-Lucas Kelley http://tylucaskelley.com - Tyler Adams http://dare.io - Tyler Peterson http://tylermarkpeterson.com - Ulises Giacoman http://udiscover.me -- Usmann Khan http://usmann.me -- Vaibhav Maheshwari http://www.vaibhavgeek.me/ -- Vaidas Mykolaitis http://www.codepreneur.io/ - Vansh Gandhi http://vanshgandhi.com -- Vardhman Mehta http://mehtav.xyz - Varun Kumar https://heysadboy.github.io/ -- Varun Rajendra Rajamane http://rajamane.io - Varun Shenoy http://varunshenoy.github.io/ -- Vedant Rathore http://vedantrathore.github.io/ -- Venkatraman Srikanth http://venkatraman.me - Vetri Selvi Vairamuthu http://vetriselvi.com -- Victor Danger Lourng http://victorlourng.com - Victor Zhou http://victorzhou.com - Vignesh M http://vigneshm.com/ - Vikas Parashar http://vikasparashar.in/ - Vikram Tiwari https://vikramtiwari.com - Vinay Hiremath https://vinayh.com -- Vinayak Mehta http://vortex-ape.github.io - Vincent Yang https://vincentyang.me - Vipin Sharma http://vipinsharma.me - Vishnu Ks http://vishnuks.com - Vishnu Narang http://vishnun.github.io - Vishnu Ravi http://vishnu.io/ -- Vivek Vaidya https://vivekvaidya.me/ - Wasim Thabraze http://thabraze.me - Will Field-Thompson http://willft.io -- William Cockburn http://syrexide.com -- William Huang http://www.hellowilliam.com - William Liu http://williamliu.me - William Woodruff http://woodruffw.us - Wilson Ding http://wilsonding.com @@ -646,13 +425,9 @@ If you'd like to see GitHub profiles, [click here](github.md). - Xiao He http://xiaojunhe.com - Yask Srivastava http://iyask.me - Yasha Mostofi http://www.yashamostofi.com/ -- Yasmeen Roumie http://roumie.me -- Yatin Gupta http://www.yatingupta.me/ - Yefim Vedernikoff http://yef.im -- Yusif Alizada http://yusifalizada.com - Zach Fogg http://zfo.gg/ - Zach Jaffee http://zjaffee.com - Zachary Espiritu http://zacharyespiritu.com -- Zakaria Ridouh https://zakariaridouh.github.io - Zakariyya Mughal http://enetdown.org/ -- Zeeshan Mughal http://www.zeeshanmughal.com +- Zeeshan Mughal http://www.zeeshanmughal.com \ No newline at end of file diff --git a/drop_dead_urls.py b/drop_dead_urls.py new file mode 100644 index 00000000..f2212181 --- /dev/null +++ b/drop_dead_urls.py @@ -0,0 +1,42 @@ +import re +import requests + + +def return_url(s): + url = s.strip().split(' ')[-1] + if url.startswith('http'): + return url + elif url.startswith('['): + url = re.search('\[(.+?)\]', url) + if url: + return url.group(1) + else: + return 'http://' + url + + +def check_line_for_reachable_url(line, file): + if line.startswith('- '): + url = return_url(line) + try: + get = requests.get(url, timeout=5) + if get.status_code == 200: + print(line) + file.write(line) + except Exception as e: + print(e) + else: + file.write(line) + print(line) + + +def drop_dead_urls(): + with open('README.md', "r") as f: + lines = f.readlines() + with open('README.md', "w") as f: + # multiprocessing? + for line in lines: + check_line_for_reachable_url(line, f) + + +if __name__ == '__main__': + drop_dead_urls() diff --git a/hooks/pre-commit b/hooks/pre-commit index 829a9033..edfd33dc 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,11 +1,8 @@ #!/usr/bin/env python from __future__ import print_function - -import os import sys -import re -import requests +import os def extract_names(file_name): @@ -20,42 +17,6 @@ def strip_url(s): return " ".join(s.strip().split(' ')[:-1]) -def return_url(s): - url = s.strip().split(' ')[-1] - if url.startswith('http'): - return url - elif url.startswith('['): - url = re.search('\[(.+?)\]', url) - if url: - return url.group(1) - else: - return 'http://' + url - - -def check_line_for_reachable_url(line, file): - if line.startswith('- '): - url = return_url(line) - try: - get = requests.get(url, timeout=5) - if get.status_code == 200: - print(line) - file.write(line) - except Exception as e: - print(e) - else: - file.write(line) - print(line) - - -def drop_dead_urls(): - with open('README.md', "r") as f: - lines = f.readlines() - with open('README.md', "w") as f: - # multiprocessing? - for line in lines: - check_line_for_reachable_url(line, f) - - def validate_ordering(): ret_val = 0 for file_name in ['README.md', 'github.md']: @@ -72,7 +33,6 @@ def validate_ordering(): strip_url(prev_line))) ret_val = 1 prev_line = line - drop_dead_urls() return ret_val