Public
Edited
Oct 16, 2022
1 fork
Insert cell
# Write a function to parse *any* row of the AA data

Building on your assignment last week, convert your code to fit into a single function, which takes as input a single string that is a <tr> tag from any of the rows of raw AA data (from any of the zones). It should output ONE array or object, depending on how you have decided to structure your data; this array or object should also have nested array(s) and object(s), to have separate containers for each "meeting" (however you define meeting).

Here is an example of a very basic function that parses, reformats/restructures, and outputs the data into a desirable JS data structure:
https://observablehq.com/@aaronxhill/a-basic-string-function (Links to an external site.)

Your submission should be an Observable notebook (published!) and you will submit its url to Canvas.

Helpful documentation for functions in JS:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions (Links to an external site.) meetingParser('1buttercup2buttercup3')

Other resources:

https://www.freecodecamp.org/news/how-to-solve-coding-problems/

Insert cell
Insert cell
tr= ` <tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">SRO Building</h4><br />
<b>A CHANCE TO LIVE AGAIN - A Chance To Live Again</b><br />
109 West 129th Street, Basement,
<br />(@ Lenox Avenue) NY 10027
<br />
<br />
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Wednesdays From</b> 6:00 PM <b>to</b> 7:00 PM <br /><b>Meeting Type</b> BB = Big Book meeting
<br />
<br />
<b>Mondays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=32" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Union Baptist Church</h4><br />
<b>AA IT WORKS II - AA It Works II</b><br />
240 West 145th Street,
<br />(Betw 7th & 8th Avenues) NY 10039
<br />
<br />
<div class="detailsBox">
Thu=Altern.BB, Living Sober & Other A.A. Literature. <br />Fri.=Alternates between Step & Tradition.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Wednesdays From</b> 10:00 AM <b>to</b> 11:00 AM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
<b>Thursdays From</b> 10:00 AM <b>to</b> 11:00 AM <br /><b>Meeting Type</b> BB = Big Book meeting
<br />
<br />
<b>Fridays From</b> 10:00 AM <b>to</b> 11:00 AM <br /><b>Meeting Type</b> S = Step meeting
<br />
<br />
<b>Tuesdays From</b> 10:00 AM <b>to</b> 11:00 AM <br /><b>Meeting Type</b> OD = Open Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=36" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Our Lady of Lourdes Church</h4><br />
<b>ATTITUDE ADJUSTMENT - Attitude Adjustment</b><br />
469 West 142nd Street, Basement,
<br />(Betw Convent & Amsterdam Avenues) NY 10031
<br />
<br />
<div class="detailsBox">
Topic 1st Saturday.
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Saturdays From</b> 7:30 AM <b>to</b> 8:30 AM <br /><b>Meeting Type</b> OD = Open Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=58" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">St. Phillip Church</h4><br />
<b>CONVENT - </b><br />
204 West 134th Street, 1st Floor,
<br />(Betw 7th & 8th Avenues) 10030
<br />
<br />
<div class="detailsBox">
B-3rd Saturday
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Saturdays From</b> 11:30 AM <b>to</b> 1:00 PM <br /><b>Meeting Type</b> OD = Open Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=1028" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Spiritual Renewal Church</h4><br />
<b>FELLOWSHIP AT NOON - Fellowship At Noon</b><br />
2044 Adam Clayton Powell Blvd.,
<br />(@ 122nd Street) NY 10027
<br />
<br />
<div class="detailsBox">
T If there is a fifth Wednesday.
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 12:15 PM <b>to</b> 1:15 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
<b>Wednesdays From</b> 12:15 PM <b>to</b> 1:15 PM <br /><b>Meeting Type</b> S = Step meeting
<br />
<br />
<b>Fridays From</b> 12:15 PM <b>to</b> 1:15 PM <br /><b>Meeting Type</b> OD = Open Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=151" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;"></h4><br />
<b>GRUPO TRASMITELO - </b><br />
469 West 142nd Street, 1st Floor,
<br />(Betw. Amsterdam & Convent Avenues) 10031
<br />
<br />
<div class="detailsBox">
Spanish speaking meeting.
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Thursdays From</b> 8:00 PM <b>to</b> 9:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=1366" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">St. Mary's Episcopal</h4><br />
<b>HARLEM HUMANISTS - </b><br />
521 W 126th St,
<br />Amsterdam & Old Broadway 10027
<br />
<br />
<div class="detailsBox">
Contact in Advance for Wheelcahir Accessibility
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 12:00 PM <b>to</b> 1:00 PM <br /><b>Meeting Type</b> O = Open meeting <br /><b>Special Interest</b> Agnostic
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=1490" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">SRO Building Community Room</h4><br />
<b>K.I.S.S. - Keep It Simple (Kiss)</b><br />
109 West 129th Street, Basement,
<br />(Betw Lenox Avenue & Adam Clayton Powell Blvd) NY 10027
<br />
<br />
<div class="detailsBox">
All meetings are non-smoking.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 5:30 PM <b>to</b> 6:30 PM <br /><b>Meeting Type</b> S = Step meeting
<br />
<br />
<b>Sundays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=229" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Our Lady of Lourdes</h4><br />
<b>LEARNING TO LIVE SOBER - Learning To Live Sober</b><br />
469 West 142nd Street, Basement,
<br />(Betw Convent & Amsterdam Avenues) NY 10031
<br />
<br />
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Thursdays From</b> 6:00 PM <b>to</b> 7:00 PM <br /><b>Meeting Type</b> BB = Big Book meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=232" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;"></h4><br />
<b>LIVING CLEAN AND SOBER ON 121st STREET - Living Clean And Sober On 121st Street</b><br />
2044 Seventh Avenue,
NY 10027
<br />
<br />
<div class="detailsBox">
S 2nd, BB 3rd, OD 4th, Living Sober 5th wk.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 6:00 PM <b>to</b> 7:30 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=237" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">S.A.G.E.</h4><br />
<b>MEDITATION COMES TO HARLEM - Meditation Comes To Harlem</b><br />
127 West 127th Street,
<br />(Betw. 7th and Lenox) NY 10027
<br />
<br />
<div class="detailsBox">
Meeting is closed on holidays
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 4:30 PM <b>to</b> 5:30 PM <br /><b>Meeting Type</b> C = Closed Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=246" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Grace Congregational Baptist Church</h4><br />
<b>MID-HARLEM - Mid-Harlem</b><br />
310 West 139th Street, Basement,
<br />(Betw Eighth & Edgecombe Avenues) NY 10037
<br />
<br />
<div class="detailsBox">
T 1st Monday at 7PM <br />Open 1st Friday 8:10pm, Pitch other Fridays 8:10pm
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> S = Step meeting
<br />
<br />
<b>Fridays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
<b>Fridays From</b> 8:00 PM <b>to</b> 9:00 PM <br /><b>Meeting Type</b> O = Open meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=250" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">St. James Church</h4><br />
<b>MONDAY NIGHT CHALLENGE - Monday Night Challenge</b><br />
409 West 141st Street, Basement,
<br />(@ St. Nicholas Avenue) NY 10031
<br />
<br />
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=261" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Riverside Church</h4><br />
<b>PRIMARY PURPOSE - Primary Purpose</b><br />
91 Claremont Avenue, 4th Floor, Room 414,
<br />(Betw. Broadway & Riverside Drive)) NY 10027
<br />
<br />
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 3:00 PM <b>to</b> 4:00 PM <br /><b>Meeting Type</b> OD = Open Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=303" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Upper Manhattan Mental Health Center</h4><br />
<b>PROMISES TWO FOR ONE - Promises Two For One</b><br />
1727 Amsterdam Avenue, 1st Floor in the rear.,
<br />(@ 145th Street) NY 10031
<br />
<br />
<div class="detailsBox">
1st Sun-OD; 2nd Sun-S; 3rd Sun-Topic; 4th Sun-T; 5th Sun-OD
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 9:30 AM <b>to</b> 10:30 AM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
<b>Sundays From</b> 11:00 AM <b>to</b> 12:00 PM <br /><b>Meeting Type</b> C = Closed Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=306" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Our Lady of Lourdes Church</h4><br />
<b>REALITY CHECK - Reality Check</b><br />
469 West 142nd Street, Basement,
<br />(Betw Convent & Amsterdam Avenues) NY 10037
<br />
<br />
<div class="detailsBox">
S 4th Saturday <br />Men's Meeting
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Saturdays From</b> 5:00 PM <b>to</b> 6:00 PM <br /><b>Meeting Type</b> OD = Open Discussion meeting <br /><b>Special Interest</b> Men
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=308" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Riverside Church</h4><br />
<b>RIVERSIDE - Riverside</b><br />
91 Claremont Avenue, @ The Cloisters Club Room,
<br />(1 Block West of Broadway & 1/2 Block North of 120th Street) NY 10027
<br />
<br />
<div class="detailsBox">
Non-Smoking Meeting.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Mondays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> C = Closed Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=315" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">St. Aloysius School</h4><br />
<b>RIVERTON - Riverton</b><br />
219 West 132nd Street, Cafeteria,
<br />(Betw. Adam Clayton Powell Blvd. & F. Douglass Blvd.) NY 10027
<br />
<br />
<div class="detailsBox">
S 2nd & T 4th Tue <br />All meetings are non-smoking. No children allowed at meetings.
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Saturdays From</b> 3:00 PM <b>to</b> 4:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
<b>Saturdays From</b> 6:00 PM <b>to</b> 7:00 PM <br /><b>Meeting Type</b> O = Open meeting
<br />
<br />
<b>Tuesdays From</b> 8:00 PM <b>to</b> 9:00 PM
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=316" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Salem United Methodist Church Community Center</h4><br />
<b>SALEM - Salem</b><br />
211 West 129th Street, Downstairs in the Gym,
<br />(@ Adam Clayton Powell Blvd.) NY 10027
<br />
<br />
<div class="detailsBox">
O 2nd Wednesday
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Wednesdays From</b> 7:30 PM <b>to</b> 8:30 PM <br /><b>Meeting Type</b> C = Closed Discussion meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=320" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Convent Baptist Church Education Building</h4><br />
<b>SOBER ADULT MEN - Sober Adult Men</b><br />
425 West 144th Street, 1st Floor,
<br />(Betw. Convent Avenue & Hamilton Terrace) NY 10031
<br />
<br />
<div class="detailsBox">
Men's Meeting
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Wednesdays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> C = Closed Discussion meeting <br /><b>Special Interest</b> Men
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=352" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">St. Phillip's Church</h4><br />
<b>ST. NICHOLAS - St. Nicholas</b><br />
204 West 134th Street, Basement,
<br />(Betw Adam C. Powell & Frederick Douglas Blvds) NY 10030
<br />
<br />
<div class="detailsBox">
S 2nd, C 3rd, BB 4th, & Grapevine 5th Thu.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 4:00 PM <b>to</b> 5:00 PM <br /><b>Meeting Type</b> O = Open meeting
<br />
<br />
<b>Thursdays From</b> 7:00 PM <b>to</b> 8:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=363" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Harlem Hospital King Pavilion</h4><br />
<b>STEPS 3 and 11 - Steps Three-Eleven</b><br />
506 Lenox Avenue, Room #3101, 3rd Floor,
<br />(@ 135 Street) NY 10037
<br />
<br />
<div class="detailsBox">
B 1st, OD 2nd, S3 3rd, C Literature 4th, & S11 5th Sun.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Sundays From</b> 2:00 PM <b>to</b> 3:00 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=367" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Council Center for Problems of Living</h4><br />
<b>SUGAR HILL - </b><br />
1727 Amsterdam Avenue, 1st floor in the rear,
<br />@ 145th St. 10031
<br />
<br />
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Fridays From</b> 5:30 PM <b>to</b> 6:30 PM <br /><b>Meeting Type</b> B = Beginners meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=1575" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;"></h4><br />
<b>TUESDAY BIG BOOK STUDY - Tuesday Big Book Study</b><br />
1854 Amsterdam Avenue, Basment,
<br />(Corner of 152nd Street) NY 10031
<br />
<br />
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Tuesdays From</b> 6:00 PM <b>to</b> 7:00 PM <br /><b>Meeting Type</b> BB = Big Book meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=390" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Our Lady of Lourdes Church</h4><br />
<b>UPTOWN BIG BOOK WORKSHOP - </b><br />
469 West 142nd Street, Basement,
<br />(Betw. Convent & Amsterdam Avenues 10031
<br />
<br />
<div class="detailsBox">
Meeting meets each Saturday from mid-August thru mid-December
</div>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Saturdays From</b> 9:30 AM <b>to</b> 11:00 AM <br /><b>Meeting Type</b> BB = Big Book meeting <br /><b>Special Interest</b> Big Book Workshop
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=1428" class="GetDirections">Get Directions</a>
</td>
</tr>
<tr style="margin-bottom:10px">
<td style="border-bottom:1px solid #e3e3e3; width:260px" valign="top">
<h4 style="margin:0;padding:0;">Metropolitan AME Church</h4><br />
<b>YOU MAY CARE AFTER - You May Care After</b><br />
58-66 West 135th Street,
<br />(Betw Malcolm X Boulevard & 5th Avenue) NY 10037
<br />
<br />
<div class="detailsBox">
Non-Smoking Meeting.
</div>
<span style="color:darkblue; font-size:10pt;">
<img src="../images/wheelchair.jpg" alt="Wheelchair Access" width="20" vspace="5" hspace="10" align="absmiddle"/>Wheelchair access
</span>
</td>
<td style="border-bottom:1px solid #e3e3e3;width:350px;" valign="top">
<b>Tuesdays From</b> 6:30 PM <b>to</b> 7:30 PM <br /><b>Meeting Type</b> S = Step meeting
<br />
<br />
</td>
<td style="border-bottom:1px solid #dedede; width:90px; ">
<a href="getdirections.cfm?meetingid=432" class="GetDirections">Get Directions</a>
</td>
</tr>
`

Insert cell
Insert cell
Insert cell
metadata = cleanMetadata(tr)
Insert cell
metadataArray= metadata.split("</td>")
Insert cell
Insert cell
// split at td to see location details

function shortenmetadata (rawText) {
var newMetadata = metadata.split("</td>")[0]
return newMetadata
}
Insert cell
newMetadata = shortenmetadata(tr)
Insert cell
Insert cell
// create a function to include locationName, addressName, address, directionInstructions, state, and zipCode

function addressDetails (rawText) {
var locationDetails = {}

rawText= rawText.replace(`<h4 style="margin:0;padding:0;">`,"</h4>")
rawText= rawText.replace("<b>","</b>")
//LOCATION NAME
locationDetails.locationName = rawText.split("</h4>")[1]
//ADDRESS NAME
locationDetails.addressName = rawText.split("</b>")[1]
//ADDRESS
locationDetails.address = rawText.split("</b>")[2].split("\n")[1]
// DIRECTION INSTRUCTION
locationDetails.directionInstructions= rawText.split("</b>")[2].split("\n")[2].split(" NY")[0]
//STATE
// locationDetails.state= "NY"
// //ZIP CODE
locationDetails.zipCode= rawText.split("</b>")[2].split("\n")[2].substr(-5)//.split(" NY ")[1]
return locationDetails
}


Insert cell
addressDetails(newMetadata)
Insert cell
{var dataArray = []
for (let i= 0; i<78; i+=3){
dataArray.push(addressDetails(metadataArray[i]))
}
return dataArray
}

Insert cell
Insert cell
//splitting the rows up into
function splitRows(rawText) {
var meetingDaysList = [];
meetingDaysList = rawText.split("</td"); //[1]
return meetingDaysList;
}
Insert cell
splitRowsArr = splitRows(tr)
Insert cell
function SourceDayTimeRows(arr) {
var newArr = [];
for (let i = 1; i < arr.length; i += 3) {
newArr.push(arr[i]);
}
return newArr;
}
Insert cell
listOfRows = SourceDayTimeRows(splitRowsArr)
Insert cell
{
var meetingRowsArr = []; //all rows meeting info
listOfRows.forEach((row) => {
//for loop 1
row = row.split("\t ");
var meetingDateArr = []; //all days of the row info
for (let i = 1; i < row.length; i++) {
//for loop 2 + skipping i=0
meetingDateArr.push(meetingFunction(row[i]));
}
meetingRowsArr.push(meetingDateArr);
});
return meetingRowsArr;
}
Insert cell
listOfRows[1]
Insert cell
//listOfDays= meetingDays(tr)
Insert cell
//taking previous line and implementing it in a foreach fn
function splitRowDays(rowArr) {
var dayArr = [];
rowArr.forEach((day) => {
dayArr.push(meetingFunction(day));
});
return dayArr;
}
Insert cell
function meetingFunction(rawText) {
var meetingDetails = {};
rawText = rawText.replace("<b>", " From</b> ");
meetingDetails.days = rawText.split(" From</b> ")[1];
meetingDetails.startTime = rawText.split("From</b> ")[1].substring(0, 8);
meetingDetails.endTime = rawText.split("</b> ")[3].substring(0, 8);
meetingDetails.meetingType = rawText.split("</b> ")[4]; //still not working
return meetingDetails;
}
Insert cell
Insert cell
final =[]
Insert cell
// metadataArray.forEach(function(part){
// var part= part
// final.push({
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more