def update(url, filename):
	"""
	Updates a file by appending current information to already known information
	"""
	flights = scraper.load(filename)	# load currently known flights from file
	if flights is None:
		flights = []
	newflights = scraper.readFlights(url)	# scrape newly available flight data from site
	for flight in newflights:
		if flight not in flights:
			flights.append(flight)	# append each new flight to the list of known flights
	scraper.save(flights, filename)	# save the updated list of flights to file
Exemple #2
0
def update(url, filename):
    """
	Updates a file by appending current information to already known information
	"""
    flights = scraper.load(filename)  # load currently known flights from file
    if flights is None:
        flights = []
    newflights = scraper.readFlights(
        url)  # scrape newly available flight data from site
    for flight in newflights:
        if flight not in flights:
            flights.append(
                flight)  # append each new flight to the list of known flights
    scraper.save(flights, filename)  # save the updated list of flights to file
Exemple #3
0
import flightmod
import scraper
import config

flights = scraper.readFlights(config.url)

for flight in flights:
	print flight