Published unlisted
Edited
Sep 22, 2022
Insert cell
Insert cell
Insert cell
tr1 = `
<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>
`
Insert cell
array = tr1.split('</td>')
Insert cell
array[0].search('Union Baptist Church')
Insert cell
array[0].search('AA IT WORKS II - AA It Works II')
Insert cell
array[0].search('240 West 145th Street')
Insert cell
array[0].search('(Betw 7th & 8th Avenues)')
Insert cell
array[0].search('NY')
Insert cell
array[0].search('10039')
Insert cell
name = array[0].substring(177,197)
Insert cell
meetingName = array[0].substring(223,255)
Insert cell
addressLine1 = array[0].substring(272,293)
Insert cell
addressLine2 = array[0].substring(308,332)
Insert cell
city = array[0].substring(333,335)
Insert cell
zipCode = array[0].substring(336,341)
Insert cell
array1 = [name,meetingName,addressLine1,addressLine2,city,zipCode]
Insert cell
array[0].search('Thu=Altern.BB, Living Sober & Other A.A. Literature.')
Insert cell
array[0].search('Fri.=Alternates between Step & Tradition.')
Insert cell
array[0].search('Wheelchair Access')
Insert cell
notes = array[0].substring(468,567).replaceAll('<br />','')
Insert cell
wheelchairAccess = array[0].substring(745,762)
Insert cell
array2 = [notes,wheelchairAccess]
Insert cell
array[1].search('Wednesdays From')
Insert cell
array[1].search('B = Beginners')
Insert cell
array[1].search('Thursdays From')
Insert cell
array[1].search('BB = ')
Insert cell
array[1].search('Fridays From')
Insert cell
array[1].search('S = ')
Insert cell
array[1].search('Tuesdays From')
Insert cell
array[1].search('OD = ')
Insert cell
wednesdayMeetingTimes = array[1].substring(129,177).replaceAll('</b>','').replaceAll('<b>','').replaceAll(' ',' ')
Insert cell
wednesdayMeetingType = array[1].substring(187,225).replaceAll('</b>','')
Insert cell
thursdayMeetingTimes = array[1].substring(305,352).replaceAll('</b>','').replaceAll('<b>','').replaceAll(' ',' ')
Insert cell
thursdayMeetingType = array[1].substring(379,400)
Insert cell
fridayMeetingTimes = array[1].substring(480,525).replaceAll('</b>','').replaceAll('<b>','').replaceAll(' ',' ')
Insert cell
fridayMeetingType = array[1].substring(552,568)
Insert cell
tuesdayMeetingTimes = array[1].substring(648,694).replaceAll('</b>','').replaceAll('<b>','').replaceAll(' ',' ')
Insert cell
tuesdayMeetingType = array[1].substring(721,741)
Insert cell
array3 = [wednesdayMeetingTimes,wednesdayMeetingType,thursdayMeetingTimes,thursdayMeetingType,fridayMeetingTimes,fridayMeetingType,tuesdayMeetingTimes,tuesdayMeetingType]
Insert cell
array[2].search('Get Directions')
Insert cell
array[2].search('a href=')
Insert cell
directions = array[2].substring(165,179)
Insert cell
directionsURL = array[2].substring(111,141)
Insert cell
array4 = [directions,directionsURL]
Insert cell
finalArray = [array1,array2,array3,array4]
Insert cell
timeString = "Wednesdays From 10:00 AM to 11:00 AM"
Insert cell
function convertTimestring (rawText) {
var newTimestring = {}
newTimestring.day = (rawText.split(' ')[0])
newTimestring.startTime = rawText.split('From')[1].trim().split(' to ')[0]
newTimestring.endTime = rawText.split('From')[1].trim().split(' to ')[1]
newTimestring.startTimeNumeric = rawText.split('From')[1].trim().split(' to ')[0].split(':')[0] * 1
newTimestring.endTimeNumeric = rawText.split('From')[1].trim().split(' to ')[1].split(':')[0] * 1
return newTimestring
}
Insert cell
convertTimestring(timeString)
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more