diff --git a/.sortedfamilytree.txt.swp b/.sortedfamilytree.txt.swp new file mode 100644 index 0000000..5708785 Binary files /dev/null and b/.sortedfamilytree.txt.swp differ diff --git a/ScrollUtil.py b/ScrollUtil.py index 4418eed..da93dbb 100644 --- a/ScrollUtil.py +++ b/ScrollUtil.py @@ -3,8 +3,62 @@ This file contains util for scroll polling Only really kept separate for neatness sake. """ +import re +from SlackUtil import reply + + +#load the family tree +familyfile = open("sortedfamilytree.txt", 'r') + +#Parse out +p = re.compile("([0-9]*): (.*)$") +brothers = [p.match(line) for line in familyfile] +brothers = [m for m in brothers if m] +brothers = [{ + "scroll": int(m.group(1)), + "name": m.group(2) + } for m in brothers] + + """ -Tells a user their scroll, or a for_users scrolls. -Is limited to telling people +Attempts to look up a user by scroll """ -def hanleScrollMsg(slack, sheet_service, msg): +def handleScrollMsg(slack, msg): + #Initialize response + response = None + + #Get text + text = msg['text'] + + p = re.compile("scroll\\s*(.*?)$") + m = p.match(text) + if not m: + response = "Could not parse your query. Please invoke as \"scroll \" or \"scroll \"" + else: + #Initially try to parse numeric + try: + #Try get scroll + scroll = int(m.group(1).strip()) + + for b in brothers: + if b["scroll"] == scroll: + response = "Brother {0} has scroll {1}".format(b["name"], b["scroll"]) + break + + #If response still none, say so + response = response or "Could not find scroll {0}".format(scroll) + + except ValueError: + #Use as name + name = m.group(1).strip() + + for b in brothers: + if name in b["name"]: + response = "Brother {0} has scroll {1}".format(b["name"], b["scroll"]) + break + + #If response still none, say so + response = response or "Could not find brother {0}".format(name) + + reply(slack, msg, response, username="scrollbot") + diff --git a/WaitonBot.py b/WaitonBot.py index 8eae6b6..f95bf16 100755 --- a/WaitonBot.py +++ b/WaitonBot.py @@ -3,6 +3,7 @@ from slackclient import SlackClient#Obvious from SlackUtil import * from WaitonUtil import handleWaitonMsg #For waitons +from ScrollUtil import handleScrollMsg #For scrolls #Read api token from file apifile = open("apitoken.txt", 'r') @@ -71,7 +72,7 @@ def main(): handleWaitonMsg(slack, sheet_service, msg, user, for_user) elif "scroll" in text: - handleScrollMsg(slack, sheet_service, msg) + handleScrollMsg(slack, msg) elif "housejob" in text: reply(slack, msg, "I cannot do that (yet)", username="sadbot") diff --git a/sortedfamilytree.txt b/sortedfamilytree.txt new file mode 100644 index 0000000..e7e9ecf --- /dev/null +++ b/sortedfamilytree.txt @@ -0,0 +1,725 @@ +1: Richard Brodeur +2: Charles T. Kleman +4: Warren Bentley +5: John P. Gahagan +6: Robert G. Bertrand +7: Jeffrey Semmel +8: Steve Schwarm +9: Robert D. Hickey +10: Joseph G. Ferrara +11: Robert C. Bell +12: Bruce Tuttle +14: Robert Stessel +15: Steve Leece +16: William D. Smith +17: Alan D. Randall +18: Richard M. King +19: Henry S. Sweet +20: John Czajkowski +21: Robert Orenberg +22: Bill Belisle +24: Steve Erikson +25: Walter J. Miska +26: David C. Johnson +27: Peter Miner +28: Peter Blackford +29: Jamon Chan +40: James F. Sinnamon +41: Daniel B. Bentley +42: Paul J. Pakus +44: James A. Metzler +45: Mark Saviet +46: Bruce Bosserman +47: Ray W. Spalding +48: John A. Giordano +49: Capt. Michael Hughes +51: Dr. Patric V. Romano +52: Kenneth R. Perkins +54: David L. Titterington, Jr. +55: Ronald C. Strand +56: Arthur E. Kreymer +57: John L. Boursy, Jr. +58: Mitchell Soivenski +59: William H. Weed +60: Paul Grady +61: Steven Chan +62: Thomas Seiferman +64: Dave Hayhurst +65: Michael W. Thayer +66: Jeffrey N. Clark +67: John D. Powers +68: Chuck Green +69: Charles R. Cain, Jr. +70: Timothy F. Laskowski +71: Gary Rand +72: Walter J. Smith, III +74: Raymond A. Moulaison +75: Joe Harkins +76: Ray Scanlon +77: Walter R. McIlveen +78: Richard L. Logan +79: Laurence Dzaugis +80: John Kulig +81: Steve Greenberg +82: Paul Melnick +84: Benjamin R. Thompson +85: Douglas A. Baird +86: John Homko +87: Bertrand A. Stanfield-Pinel +88: John W. Watkins +89: Marston Duffy +90: Bernard O. Bachenheimer +91: Daniel Prior +92: Andrew Wemple +94: Stephen A. Swisher +95: Barry M. Hynds +96: Gary Bellinger +97: Charles Jutras +98: Hunt Sutherland +99: Robert Parnass +100: Davis Balestracci, Jr. +101: George Clark +102: David R. Lyons +104: Chester A. Kokoszka +105: William H. Murwin +106: Rich Ludorf +107: Peter J. Joyce +108: Richard B. Keeler +109: Richard Norton +110: Ed Prentice +111: Bruce MacWilliam +112: Jeffrey R. Tacconi +114: Kent Berwick +115: Robert Hart +116: Bob Andren +117: Robert Byron +118: Robert Pinolehto +119: Jonathan S. Kardell +120: James F. Lane +121: Jeff Birkner +122: Walter Hoenig +124: Jay Pulli +125: John G. Yamashita +126: James Roach +127: Don R. Lounsbury +128: Stewart D. King, Jr. +129: John Kowalonek +140: Charles R. Lauzon +141: John Kowalchuk +142: David Altieri +144: John Kuklewicz +145: Edwin L. Knight +146: Robert W. Horton +147: Mark J. Deutsch +148: Timothy R. Ascani +149: Robert Howard +150: Edward J. Smith +151: James Craffey +152: Vincent - Rucinski +154: David C Jones +155: Stephen D'allessandro +156: Mark Sturtevart +157: Martin Grossman +158: Randall C. LaPlante +159: Alan Turniansky +160: John P. Heslin +161: John F. Downes +162: Hector Cabrera +164: John Haponik +165: Timothy F. Bamford +166: Dan Gauvin +167: Glenn R. Baylis +168: Alfred J. Marotta +169: Adrian C. McIlveen +170: Iginio Capaldo +171: Glenn Cooley +172: Paul E. Craffey +174: James J. Collins +175: Raymond Elveson +176: Michael Bosowski +177: Dave Konieczny +178: John Pardo +179: David B. Fox +180: Conrad From +181: Robert T. Picchione +182: Jason P. Tuell +184: David Giusto +185: George F. Tobin, Jr. +186: Brian L. Stoffers +187: Steve Stocking +188: Jeffrey Bedell +189: Jim Conoby +190: Steven Duso +191: Halvard H. Solberg +192: Keith Duclos +194: Chester C. Przybylowicz, Jr. +194: Chester C. Przyb ylowicz, Jr. +195: Stephen Knight +196: Joseph A. Bischof +197: Fausto Garcia +198: Eric Standish +199: Eric Fischer +200: Robert Reinfurt, Jr. +201: John Giguere +202: Edward Hines +204: Robert B. Frazier +205: Joseph Zayonc +206: John Power +207: Mark J. Ramberg +208: Michael T. Treglia +209: Matt Goldman +210: Peter F. Young +211: John Cameron +212: Robert Overman +214: Chris Duggan +215: Daniel Alcombright +215: Daniel Alcomb right +216: Brian McLaughlin +217: Richard Thomas +218: Bruce Black +219: Andrew J. Krassowski +220: Stephen Fiorelli +221: Thomas Casale +222: Mark N. Ramburg +224: Keith R. Burkes +225: John F. Paladino +226: Dariusz Laskowski +227: John G. Antoniou +228: Robert P. Sawyer +229: John M. Summers +240: Mitch Wright +241: Steven Gardner +242: Robert E. Power +244: Robert J. Morteu +245: William E. Flynn, Jr. +246: Richard S. Hilow +247: William G. Andrews +248: David Sauerbrey +249: John R. Iannarone +250: Nicholas J. Barber +251: Daniel E. Holden +252: Steven Baturin +254: Mark Stanley +255: James A. Duncan +256: Ralph A. Casale +257: Bill Baron +258: Andy Cott +259: John E. Bozenhard +260: Brian J. Keogh +261: Don Waltman +262: Jeff Remillard +264: Arra Yeghiayan +265: John M. Scannell +266: Christopher J. Stakuitis +267: Richard A. Rydant +268: Michael Palmer +269: Edward J. Devin +270: George S. Graw +271: Quentin J. Brown +272: Jim Nichols +274: Robert G. Bergland +274: Rob ert G. Bergland +275: Steve Mann +276: John J. Niedzielski +277: Mike Salk +278: John Whyte +279: Curt Duffy +280: John Sieganthaler +281: Dennis Nagle +282: Gordon C. Griffin +284: Marc A. Viera +285: Elliot Scott +287: Chris MacDonnel +288: Jim Hannon +289: Tom Peterson +290: Dan Farkas +291: Jim Myran +294: A. Patrick Tormey +295: George Carey, Jr. +296: John McEnaney +297: Jeff Graves +298: Ara Barmakian +299: Matt Mooney +400: Mike Basmajian +401: Aswin Pinsuvana +402: Christopher Mastriani +404: Paul Amons +405: Thomas Tashjian +406: Gregory C. Thomson +407: Bill Iannacci +408: Vinay Kundaje +409: James Forbes +410: Frederick Zacharias +411: Gary Goodell +414: Dave Padley +415: Kyoyul Oh +416: Jay S. Nigen +417: Perter P. Polit +418: Dave Cubanski +419: David Smith +420: Sean P. Sweeney +421: Anthony Thomas Beville +422: Andy Siegel +424: James McDermott +425: Charles Cooleridge, Jr +426: Wayne C. Jarrett +427: Paul Lavigne +428: John Q. Bagdasarian +429: Mike Iannacci +440: Paul LoPiccolo +441: Mark Siciliano +442: Peter P. Perrotti +444: David M Beaudin +445: Mikey Pomerleau +446: Sergio Rivas +447: Christopher Charles Blume +448: James M. Mach +449: Kenneth James Carpenter +450: Keith Pflieger +451: Sean Hunt +452: Todd A Parker +454: Ken Hamilton +455: Rick Rogers +456: David A. DiBattista +457: Albert G. Prescot, 2nd +458: Kevin A. Bowen +459: Fred Gold +460: Brian Murphy +461: Jay Larrow +462: Douglas Lenox +464: John W. Boyle +465: Dave Stec +466: Michael Bowen +467: Andrew A. Aberdale +468: Timothy Tripoli +469: Keary J. Griffin +470: Scott MacKenzie +471: Jeff McConnell +472: Steve Bullied +474: Walter F. Daly III +475: Jonas Dedinas +476: Paul Cotellesso +477: Robert H. Elden +478: John P. Gasstrom +479: Michael J. Vinskus +480: Kevin E. Duprey +481: Christopher Caforio +482: John Wodziak +484: Daniel Falla +485: Mike Allen +486: Michael J Lemberger +487: Kevin M. Daniels +488: Daniel Whelan +489: Walden Leverich +490: Peter J. Anamasi +491: Daniel Falk +492: Chad Stein +494: James F. Sheehan +495: Jay McGaffigan +496: Corydon Shimer +497: Michael E. Henry +498: Matthew B. Teague +499: Patrick Cambell +500: Dan Levine +501: Eric J. Rosentel +502: Brian Malone +504: Christopher L. Savina +505: Mark Gibelli +506: Jeffrey S. Leiner +507: Christopher H. Patstone +508: Michael Schiller +509: Tim O'Connor +510: Ron Passerini +511: Daniel R. P. Spencer +512: Steven John Becker +514: Christopher Trotta +515: Brian Treece +516: David Joseph Colombo +517: Nate York +518: Kevin Geoffroy +519: Alfred J. Costa +520: John Swindell +521: Robert Tracy Moore +524: William H. Barry +525: Suppasak Collins +526: Jeremy Delorey +527: Kevin Waid +528: Thomas A. Pane +529: Lenard Soto +540: Adnan Mirza +541: Dinis Pimentel +542: Rob Stacy +544: Jeff Haye +546: Chris Kmiec +547: Greg H. Lichniak +548: Don Cournouyer +549: Michael A. Kimack +550: Brian Gerry +551: Chris Pisz +552: Chris Greatens +554: Aaron Eckstrom +555: Oral Allen +556: Ian Cote +557: Chris Roe +559: Jeffrey Modderno +560: Christopher R. Labossiere +561: Glen Gaebe +562: Michael E. Miller +564: Brian Karnes +565: Jason Paradis +566: Rob Jackson +567: Mark Tucker +568: Michael Frederick Teliszewski +569: Robert F. Tonning +570: Leo Gestetner +571: Richard Heidebrecht +572: Francis I. Bronco, Jr. +574: Jeffry Michael Proulx +575: John Kedziora +576: Jim Metzler +577: Jose Orbegozo +578: Jeff White +579: David LaCarubba, Jr +580: Brian Fuller +581: Luke Demoracski +582: Alex Patrao +584: Keith Thornley +585: Chris Kuiawa +586: Thomas E. Forcier +587: Joe Magnotti +588: Andrew Feld +589: Rob Foster +591: Michael L. Andrus +594: William Randal Gilbert +595: Nathan Hendrix +596: John Brian Stewart +597: Matt Tricomi +598: John B. Pieper +599: Brad Michaelis +600: Eric James Gusek +601: Arthur Rossomando +602: Doug Sullivan +604: Luke Poppish +605: Andre Orbegozo +606: Ken Knowles +607: Pete Wysocki +608: Jay Bourgeois +609: Brian Carey +610: Antonio Oses +611: Lino Brosco +612: Radoslav Viktorin +614: Theodoric Panton +615: Brian Bresnahan +616: Sean Gregory +617: Mark Forget +618: Istifan Ghanem +620: Joseph Maraia +621: Gerard C. Mangenot +622: Keven Carpenter +624: Mario Tongol +625: Jon Tanner +626: Matt Anselm +627: Randy McMahon +628: Bob Parette +629: Steve Milburn +640: John Stevens +641: David Wyman +642: Matt Craig +644: John Casill +645: Jamie Karl +646: Emar Tongol +647: Nick Amaral +648: Pete Tessier +649: Ken Ozeni +650: Nathan Campoli +651: Ravi Misra +652: Sam Girgis +654: Larry Ryan Coffren +655: David Silva +657: Brendan Casey +658: Thomas Collins +659: Andy Kern +660: Ralph Thompson +661: Mike Bozzi +662: Pete Gonsalves +664: Tim Pedro +665: Ken Fountain +667: Deb Banerjee +668: Luke Smith +669: Jaseem Hasib +670: Sean Wickman +671: Will Alter +672: Andy Stone +674: Nate Thompson +675: Mark Sadberry +676: Jose Magararu +677: Rich Kuzsma +678: Andrew Houde +679: Jon Stambaugh +680: Andy DeMars +681: Scott Bowden +682: Josh Allor +684: Jeff Cusato +685: Chris Hill +686: Chandra M.V.S. +687: Edwin Martin +688: Joseph Ho +689: Jeff Camara +690: Adam Berman +691: Jordan Maddok +692: Jon Hurst +694: Mark Anderson +695: Patrick Pastecki +696: Brian Conway +697: Kevin Harsip +698: Jeffrey A. Fortin +699: Thomas F. Maguire +700: Jarred Gallagher +701: Jason Li +702: Anthony Snyder +704: Luis Costas +705: Steve Sprowson +706: Michael Andren +707: Shawn Purcell +708: David Belliveau +709: Brian Weindling +710: Adam Siegal +711: Luiz Santos +712: Kevin Derwin +714: Christopher Coy +715: Andre Quina +716: Chris Vigneau +717: Steven Kaelin +718: Tony Maietta +719: Gary Madirosian +720: Vincent Fusca +721: Jordan Weigler +722: Cory Melemed +724: Joel Gottshalk +725: Sid Rupani +726: Andy Kim +727: Domenic Giancola +728: William Espinola +729: Jesse Tippett +740: Eric Hall +741: Mike Carbonello +742: Joe Hsu +744: Jason Gronlund +745: Mike Frysinger +746: Mike Fortier +747: Matt Benvenuti +748: Edwin Nieves +749: Andrew Fowler +750: Rob Trotte +751: Dan Boothe +752: William Hebert +754: Jimmy Wang +755: Jordan Cormier +756: Jake Varney +757: Paul Marchetti +758: Mike Robinson +759: Dave Voutila +760: Jon Mulla +761: Brian Berk +762: Brian O'Donnell +764: Derek Chen +765: Tony Fortunato +766: Jeremy Cote +767: Yury Alkhazov +768: Nate Chin +769: Matt Densmore +770: Garrett Ebersole +771: Fred Vanston +772: Tofer Carlson +774: Greg Salvati +775: Ian Phillips +776: Jon Hurst +777: Marc Cyr +778: Colin Marker +779: Tim Krawiec +780: Marc DiNino +781: Doug Fritz +782: Genesis Quemuel +784: John Parretti +785: Sam Gambrell +786: Freddy Jervis +787: Pat Canny +788: John Rogers +789: Pratap Rao +790: Craig Gallot +791: Pat Kelly +792: Ryan Tully +794: Dan Bartl +795: Chris Donoghue +796: Pace Ricciardelli +797: Stuart Webster +798: John Folliard +799: Mike Padden +800: Justin Clouthier +801: Eric Koethe +802: Andy Kipp +804: Matthew Goon +805: Cameron Dunaj +806: Kenneth Dawe +807: Todd Bitner +808: Adam Tracy +809: Joe Bailey +810: Michael Fecteau +811: Noah Pendleton +812: Matthew Fuhrmeister +814: Kyle Kappmeyer +815: Anthony DiStefano +816: Barry Kosherick +817: Naren Nayak +818: Ryan Pagano +819: Dimosthenis Nikitas +820: Bernie Lis +821: Pat Sheehan +822: Justin Perron +824: Garrett Cavanaugh +825: Mike Moscardini +826: Brandon Patchel +827: Alex Demers +828: Skyler Clark +829: James Repass +840: Brendan McMasters +841: Gerard Dwan +842: Ben St. James +844: Peter Eliopoulos +845: Ben Buck +846: Albert Lo +847: John Durst +848: Matt Pasceri +849: Brian Barnhill +850: Kevin O'Brien +851: William Hnath +852: Stephen Jakubowski +854: Shaun Tirrell +855: Sam Kaplan +856: Tim McMath +857: Dimitris Saragas +858: Lawson Glidden +859: Sean Joyce +860: Andrew Labak +861: Hunter Senft-Grupp +862: Chris Szlatenyi +864: Patrick Benson +865: Charlie Fancher +867: Dylan Sweeney +868: Greg Walls +869: Jarrett Arredondo +870: Pat DeSantis +872: Udit Adhikari +874: Alex Muir +875: Eric Murphy +876: Garret Doe +877: Rob Banahan +878: Nathan Kristoff +879: Andrew Yee +880: Brian Grabowski +881: Sean Beck +882: Meshal Alausfour +884: Manu Bhalla +885: Brendan Harris +886: Jared Brown +887: Dan Hartman +888: Michael Jenkins +889: John Wilder +890: Nicholas Allen +891: Isaac Barbour +892: Sean Crepeau +894: Ian Lonergan +895: Shane Daley +896: Patrick Knight +897: Jeffrey Laun +898: Migdoel Alvarado +899: John William Hatzis +900: Wyatt Brewster Gray +901: Alexander Jacob Misch +902: Edward Eric Allison +904: Keegan James Leitz +905: James Kirk Arsenault +906: Richard James Speranza +907: Alexander Alan Flores Padilla +908: Jeffrey Michael Perron +909: Nicholas Adams Silvia +910: Benjamin Scott Timms +911: Evangelos Konstantinos Koumbaros +912: Robert Steven Allen +914: Otilio Depina +915: Shane William Waterman +916: Zachary A. Duca +917: Robert Edward Puishys III +918: Michael Alexander Pelissari +919: Jonathan Boeglin +920: Brandon Amir Okray +921: Anthony Joseph DeCicco +922: William Henry Wright +924: Derek Allen Carey +925: Justin Mathews +927: Alex William Rebh +928: Ned Shelton +929: Shrid Ambady +940: Ryan Santos +941: Mark Mantell +942: Cy Ketchum +944: Pat Sheppard +945: TJ Watson +946: Jake Nutting +947: Matt Bailey +948: Will Bermender +949: Chris Dillon +950: Jon Zee +951: Mike Murillo +952: Connor Pugliese +954: Matt Roy +955: Eric Corriveau +956: Brian Eccles +957: Ryan Casey +958: Nate Sweet +959: Andy Larsen +960: Philip Radder +961: Christian Gonzalez +962: Nicholas Hewgley +964: William Thomas Frankian - 926 Eric Zandrow +965: Mark Swanson +966: Jeffrey Collard +967: John Scarborough +968: Nathan Ferron +969: Alex Henning +970: Zhi Hao "Ed" Li +972: Eric Willcox, III +974: David Kelly +975: Nathan Curtis +976: Jordan Brauer +977: Nicholas Rowles +978: Gavin Hayes +979: Andrew Davis +980: William Spurgeon +981: Pete Guarino +982: Robert Flemming - 971 Nicholas King +984: David Moore +985: Tommy Trieu +986: Christopher Connor +987: Tung Truong +988: Timothy Whitworth +989: Evan King +990: Matthew Carnein +991: Matthew Jackman +992: Jon Metzger +994: Benjamin Sarkis +995: Colin Maki +996: Brandon Coll +997: Timothy Jones +998: Andrew Aberdale II +999: Alexander Horton +1000: Daniel Lemire +1001: Drew Tisdelle +1002: Daniel Pongratz +1004: Luis Fernandez +1005: Mervyn Larrier +1006: Jeff Robinson +1007: Joey Perez +1008: Andrew Brunelle +1009: Ziyang "Gavin" Yu +1010: Tucker Martin