示例#1
0
def getJSON():
	try:
		page = urllib2.urlopen('https://akron.score.org/content/take-workshop-282')
		soup = BeautifulSoup(page, "html.parser")
		title = soup.find_all("h4", {'class' : 'content-block__title'}) #string.strip
		location = soup.find_all("span", {'itemprop' : 'streetAddress'}) #string.strip
		description = soup.find_all("div", {'itemprop' : 'description'}) #get_text
		date = soup.find_all("div", {'class' : 'content-block__extra content-block__event-date'})

		toJSON = []


		for i in range(len(title)):

			dateAndTime = date[i].string.strip()
			calendarDate = dateAndTime[0:dateAndTime.find(',', dateAndTime.find(',') + 1)]
			time = dateAndTime[dateAndTime.find(',', dateAndTime.find(',') + 1) + 1 : - 4]
			toJSON.append({
							'website': 'https://akron.score.org/content/take-workshop-282',
							'title' : title[i].string.strip(),
							'location' : location[i].string.strip(),
							'description' : description[i].get_text(),
							'date' : helperFunctions.monthToNum(calendarDate[0:calendarDate.find(" "):]) + "-" + calendarDate[calendarDate.find(" ") + 1 : calendarDate.find(",")],
							'time' : time
						  })
		return toJSON
	except:
		return ''
def getJSON():
	try:
		hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
	       'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
	       'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
	       'Accept-Encoding': 'none',
	       'Accept-Language': 'en-US,en;q=0.8',
	       'Connection': 'keep-alive'}
		req = urllib2.Request('https://www.kent.edu/vcd/news-archive', headers=hdr)
		page = urllib2.urlopen(req)
		soup = BeautifulSoup(page, "html.parser")
		event = soup.find_all("div", {'class' : 'panel-panel panel-col'})

		toJSON = []

		for i in range (len(event)):

			date = event[i].get_text().strip()
			date = helperFunctions.removeDayOfWeek(date[date.find('\n') + 1 : ].strip()).strip()
			thisDate = helperFunctions.monthToNum(date[:date.find(' ')]) + '-' + date[date.find(' ') + 1: date.find(',')]
			thisTime = date[date.find("-") + 2 :]

			toJSON.append({

		 					'website':'https://www.kent.edu/vcd/news-archive',
		 				  	'title' : event[0].div.h3.get_text().strip(),
		 				  	'location' : '',
		 				  	'description' : '',
		 				  	'date' : thisDate,
		 				  	'time' : thisTime
		 				  })
		return toJSON

	except:
		return ''
示例#3
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request('https://www.jumpstartinc.org/calendar/',
                              headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        event = soup.find_all("header", {'class': 'entry-header'})
        description = soup.find_all("div", {'class': 'entry-content'})
        date = soup.find_all("span", {'class': 'event-date'})

        #print len(title)
        #print len(location)

        toJSON = []

        for i in range(len(event)):
            try:
                location = event[i].span.get_text().replace("Location: ", '')

            except AttributeError:
                location = ''

            thisDate = date[i].get_text()
            thisDate = helperFunctions.monthToNum(
                thisDate[thisDate.find(',') +
                         2:thisDate.find(' ',
                                         thisDate.find(' ') + 1)]
            ) + '-' + thisDate[thisDate.find(' ',
                                             thisDate.find(' ') + 1):].replace(
                                                 ' ', '')

            toJSON.append({
                'website': 'https://www.jumpstartinc.org/calendar/',
                'title': event[i].h2.a.get_text(),
                'location': location,
                'description': description[i].get_text(),
                'date': thisDate,
                'time': ''
            })

        return toJSON

    except:
        return ''
示例#4
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request('http://www.glideit.org/news-and-events/events',
                              headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        title = soup.find_all("span", {'itemprop': 'name'})
        event = soup.find_all("div",
                              {'class': 'eb-category-1 eb-event clearfix'})
        description = soup.find_all("div",
                                    {'class': 'eb-description-details span7'})
        date = soup.find_all("div", {'class': 'span5'})

        toJSON = []

        for i in range(len(event)):
            thisDate = date[i].tbody.tr.td.findNext('td').get_text().replace(
                '\t', '').replace('\r', '').replace('\n', '')
            thisDate = helperFunctions.monthToNum(
                thisDate[:thisDate.find(' ')]
            ) + '-' + thisDate[thisDate.find(' ') + 1:thisDate.find(',')]
            toJSON.append({
                'website':
                'http://www.glideit.org/news-and-events/events',
                'title':
                event[i].div.h2.a.span.get_text(),
                'location':
                date[0].tbody.findNext('tr').findNext('tr').findNext(
                    'tr').findNext('td').findNext('td').get_text().replace(
                        '\t', '').replace('\r', '').replace('\n', ''),
                'description':
                description[i].get_text().replace('\n', ''),
                'date':
                thisDate,
                'time':
                ''
            })
        return toJSON

    except:
        return ''
示例#5
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request(
            'https://www.eventbrite.com/o/launchnet-kent-state-university-4732963441',
            headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        title = soup.find_all("div", {'class': 'list-card__title'})
        location = soup.find_all("div", {'class': 'list-card__venue'})
        date = soup.find_all("time", {'class': 'list-card__date'})
        toJSON = []

        thisDate = date[0].get_text().replace(' ', '').strip()
        time = thisDate[thisDate.find('\n') + 1:]

        for i in range(len(title)):

            dateAndTime = date[i].get_text().replace(' ', '').strip()
            thisDate = dateAndTime[dateAndTime.find(',') +
                                   1:dateAndTime.find('\n')]
            thisDate = helperFunctions.monthToNum(
                thisDate[:3]) + '-' + thisDate[3:]
            thisDate = thisDate.replace('Mul-tipleDate', 'Multiple Dates')
            thisTime = dateAndTime[dateAndTime.find('\n') +
                                   1:].lower().replace('multipledates', '')

            toJSON.append({
                'website':
                'www.eventbrite.com/o/launchnet-kent-state-university-4732963441',
                'title': title[i].get_text().strip(),
                'location': location[i].get_text().strip(),
                'description': '',
                'date': thisDate,
                'time': thisTime
            })
        return toJSON

    except:
        return ''
示例#6
0
def getJSON():
	try:
		hdr = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
	       'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
	       'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
	       'Accept-Encoding': 'none',
	       'Accept-Language': 'en-US,en;q=0.8',
	       'Connection': 'keep-alive'}
		req = urllib2.Request('https://www.kent.edu/yourtrainingpartner/calendar-program-offerings', headers=hdr)
		page = urllib2.urlopen(req)
		soup = BeautifulSoup(page, "html.parser")
		title = soup.find_all("div" , {'class' : 'views-field views-field-title'})
		date = soup.find_all("span", {'class' : 'date-display-single'})
		parsedDate = []

		for x in range (len(date)):
			if ((x % 2) == 0):
				parsedDate.append(date[x])

		toJSON = []

		for i in range (len(title)):
		
			for a in title[i].find_all('a', href=True):
				page = urllib2.urlopen('https://www.kent.edu' + a['href'])
				soup = BeautifulSoup(page, "html.parser")

			description = soup.find('meta', {'name' : 'description'})
			thisTime = helperFunctions.removeDayOfWeek(parsedDate[i].get_text()).lstrip()
			location = soup.find('div', {'class' : 'views-field views-field-field-price'})
			thisDate = helperFunctions.monthToNum(thisTime[:thisTime.find(' ')]) + '-' + thisTime[thisTime.find(' ') + 1: thisTime.find(',')]
			thisTime = thisTime[thisTime.find(':') - 2 : thisTime.find(':') + 7].lstrip()
			

			

			toJSON.append({
		 					'website':'www.kent.edu/yourtrainingpartner/calendar-program-offerings',
		 				  	'title' : title[i].get_text(),
		 				  	'location' : '',
		 				  	'description' : description['content'],
		 				  	'date' : thisDate,
		 				  	'time' : thisTime
		 				  })

		return toJSON

	except:
		return ''
示例#7
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request(
            'https://womensnetworkneohio.com/Events?EventViewMode=1&EventListViewMode=1',
            headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        event = soup.find_all("div", {'class': 'boxInfoContainer'})
        title = soup.find_all("h4", {'class': 'boxHeaderTitle'})

        toJSON = []

        for i in range(len(event)):
            date = event[i].ul.li.div.get_text()
            date = helperFunctions.monthToNum(
                date[:date.find(' ')]) + '-' + date[date.find(' ') +
                                                    1:date.find(',')]

            time = event[i].ul.li.next_sibling.next_sibling.div.span.get_text()
            time = time[:time.find('-')].strip().lower().replace(' ', '')

            location = event[
                i].ul.li.next_sibling.next_sibling.next_sibling.next_sibling.div.span.get_text(
                )

            toJSON.append({
                'website': 'noche.org/modules/calendar/calendar.php',
                'title': title[i].get_text().replace('\n', ''),
                'location': location,
                'description': '',
                'date': date,
                'time': time
            })

        return toJSON

    except:
        return ''
示例#8
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request(
            'https://www.eventbrite.com/o/magnet-the-manufacturing-advocacy-and-growth-network-8168803133',
            headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        title = soup.find_all("div", {'class': 'list-card__title'})
        location = soup.find_all("div", {'class': 'list-card__venue'})
        time = soup.find_all("time", {'class': 'list-card__date'})

        toJSON = []

        for i in range(len(title)):

            dateAndTime = time[i].get_text().strip()
            thisDate = dateAndTime[:dateAndTime.find('\n')]
            thisDate = thisDate[thisDate.find(' ') + 1:]
            thisDate = helperFunctions.monthToNum(
                thisDate[:thisDate.
                         find(' ')]) + "-" + thisDate[thisDate.find(' ') + 1:]
            thisTime = dateAndTime[dateAndTime.find('\n') +
                                   1:].strip().replace(' ', '').lower()

            toJSON.append({
                'website':
                'www.kent.edu/yourtrainingpartner/calendar-program-offerings',
                'title': title[i].get_text().strip(),
                'location': location[i].get_text().strip(),
                'description': '',
                'date': thisDate,
                'time': thisTime
            })
        return toJSON

    except:
        return ''
示例#9
0
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request('http://noche.org/modules/calendar/calendar.php',
                              headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        title = soup.find_all("span", {'class': 'event-title'})
        location = soup.find_all("span", {'class': 'tip-container'})
        date = soup.find_all("ul", {'class': 'eventlist'})

        toJSON = []

        for i in range(len(title)):
            timeAndDate = location[i].get_text()
            time = timeAndDate[timeAndDate.find('Time: '):timeAndDate.
                               find('-')].replace('Time: ', '').replace(
                                   ' ', '').strip().lower()
            location = timeAndDate[timeAndDate.find('Location: '):].replace(
                'Location: ', '')
            location = location[:location.find('\n')]
            day = date[i].parent.find("div", {'class': 'date'}).get_text()

            thisDate = str(helperFunctions.monthToNum(
                datetime.now().month)) + '-' + day

            toJSON.append({
                'website': 'noche.org/modules/calendar/calendar.php',
                'title': title[i].get_text(),
                'location': location,
                'description': '',
                'date': thisDate,
                'time': time
            })
        return toJSON

    except:
        return ''
示例#10
0
def getJSON():
    try:
        page = urllib2.urlopen('http://akronsbdc.org/calendar/')
        soup = BeautifulSoup(page, "html.parser")
        title = soup.find_all("span", {'class': 'ai1ec-event-title'})
        location = soup.find_all("span", {'class': 'ai1ec-event-location'})
        description = soup.find_all("div",
                                    {'class': 'ai1ec-event-description'})
        month = soup.find_all("div", {'class': 'ai1ec-month'})
        day = soup.find_all("div", {'class': 'ai1ec-day'})
        time = soup.find_all("div", {'class': 'ai1ec-event-time'})

        toJSON = []

        for i in range(len(title)):
            eventTime = time[i].string.strip()
            if (eventTime.find("am") == -1):
                eventTime = eventTime[eventTime.find("@") +
                                      2:eventTime.find("pm") + 2]
            else:
                eventTime = eventTime = eventTime[eventTime.find("@") +
                                                  2:eventTime.find("am") + 2]
            eventTime = eventTime[:eventTime.
                                  find(" ")] + eventTime[eventTime.find(" ") +
                                                         1:]
            toJSON.append({
                'website':
                'http://akronsbdc.org/calendar/',
                'title':
                title[i].get_text().replace(location[i].get_text(),
                                            '').replace('\n',
                                                        '').replace('\t', ''),
                'location':
                location[i].string.strip(),
                'description':
                description[i].get_text().replace('\n', ''),
                'date': (helperFunctions.monthToNum(month[i].string.strip()) +
                         '-' + day[i].string.strip()),
                'time':
                eventTime
            })

        return toJSON

    except:
        return ''
def getJSON():
    try:
        hdr = {
            'User-Agent':
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
            'Accept-Encoding': 'none',
            'Accept-Language': 'en-US,en;q=0.8',
            'Connection': 'keep-alive'
        }
        req = urllib2.Request(
            'https://www.meetup.com/Akron-Women-In-Tech/events/', headers=hdr)
        page = urllib2.urlopen(req)
        soup = BeautifulSoup(page, "html.parser")
        event = soup.find_all("div", {'class': 'eventContent'})
        eventTitle = soup.find_all("span", {'class': 'eventName summary'})
        toJSON = []

        for i in range(len(event)):
            thisDate = event[i].a.span['title']
            thisDate = helperFunctions.monthToNum(
                thisDate[:3]) + '-' + thisDate[thisDate.find(' ') +
                                               1:thisDate.find(',')]

            toJSON.append({
                'website':
                'https://www.meetup.com/Akron-Women-In-Tech/events',
                'title':
                eventTitle[i].get_text().replace('\n', '').strip(),
                'location':
                '',
                'description':
                '',
                'date':
                thisDate,
                'time':
                event[i].a.span.get_text().replace(' ', '').lower()
            })
        return toJSON

    except:
        return ''
示例#12
0
def getJSONAkron():
	try:
		page = urllib2.urlopen('https://www.ecdi.org/events/akron')
		soup = BeautifulSoup(page, "html.parser")
		event = soup.find_all("div", {'class' : 'row class-listing'})

		title = []
		description = []
		date = []
		toJSON = []

		for getEvent in event:
			title.append(getEvent.div.h4.get_text())
			date.append(getEvent.p.em.get_text())
			description.append(getEvent.p.next_sibling.next_sibling.get_text())

		for i in range(len(title)):
			thisDate = date[i]
			thisTime = thisDate[thisDate.find(':') - 2 : thisDate.find(':') + 6].lower()
			if(thisTime[0] == ' '):
				thisTime = thisTime[1:]
			if(thisTime[4] == ' '):
				thisTime = thisTime[:4] + thisTime[5:]
			if(thisTime[5] == ' '):
				thisTime = thisTime[:5] + thisTime[6:]
			if((thisTime.find('am') == -1) and (thisTime.find('pm') == -1)):
				thisTime = thisTime[:-2]


			toJSON.append({
							'website': 'https://www.ecdi.org/events/akron',
							'title' : title[i],
							'location' : 'Akron',
							'description' : description[i],
							'date' : helperFunctions.monthToNum(thisDate[thisDate.find(',') + 2 : thisDate.find(',') + 5]) + "-" + thisDate[thisDate.find(' ', thisDate.find(' ') + 1) + 1 : thisDate.find(' ', thisDate.find(' ') + 1) + 3], 
							'time' : thisTime
						 })
			
		return toJSON
	except:
		return ''