'''
Created on September 19, 2017

@author: Susan Rodger
'''
import urllib2
import random


# Earthquake  with extra stuff for lecture


def quakesMystery(letter, quakes):
    loclist = []
    for item in quakes:
        p = getParts(item)[-1]
        if letter in p:
            loclist = loclist + [item]
    return loclist


def quakesMystery2(quakes):
    temp = ""
    for item in quakes:
        one = getParts(item)[-1]
        if len(one) > len(temp):
            temp = one
    return temp






def fileToList(url):
    '''
    This function reads a file from a given url 
    returns a list of strings where each string 
    represents one line from the file
    The string should be in the specified format.
    '''
    # PUT YOUR CODE HERE
    pass


def getParts(line):
    # return the line as a list of magnitude, type and location
    # PUT YOUR CODE HERE
    pass
        
    
def printQuakes(alist, num):
    # print num quakes. If num is -1 then print all
    # PUT YOUR CODE HERE
    pass



if __name__ == '__main__':
    '''
    Starting part of the earthquake program
    Read a file of earthquake data and answer
    several queries about the data.
    '''
    urlstart = "http://www.cs.duke.edu/courses/compsci101/fall17/data/"
    
    #datafile = "earthqDataAug14-Sep13-2017.txt"
    datafile = "earthqDataSmallSep2017.txt"
    eqList = fileToList(urlstart+datafile)
    
    print "For Lecture"
    print "quakesMystery"
    someList = quakesMystery("a", eqList)
    printQuakes(someList, 5)
    
    
    print "quakesMystery2"
    some = quakesMystery2(eqList)
    print some
    
    
    
    
    
