Ejemplo n.º 1
0
                latitude = float(DB[tweet]['place'][u'bounding_box'][u'coordinates'][0][0][1])
                if (category == 'PO'):
                    po_lon.append(longitude)
                    po_lat.append(latitude)
                elif category == 'PL':
                    pl_lon.append(longitude)
                    pl_lat.append(latitude)

    po_scatter_path = (po_lat,po_lon)
    pl_scatter_path = (pl_lat,pl_lon)

    if (city is 'US'):
        mymap = GoogleMapPlotter(39.908213, -99.675441, 4)
    else:
        mymap = GoogleMapPlotter.from_geocode(city, 12)
        lat, lng = mymap.geocode(city)
    for group in ultralist:
        drawGroupBox(group,mymap)
        
    mymap.scatter(po_scatter_path[0], po_scatter_path[1], c='tomato', marker=True)
    mymap.scatter(pl_scatter_path[0], pl_scatter_path[1], c='lemonchiffon', marker=True)
    mymap.draw('./mymap.html')
    webbrowser.open(tweetMap)
        
    
if (searchType == 'real'):
    startDate = raw_input('Enter todays date: ')

    while True:
        for tweet in DB:
            date = DB[tweet][u'created_at']