Example #1
0
def tweetsearch_arrange_by_distance_from_paris(tweets_list):
    """ Sorts the tweetsearch list """
    tweets_distance = []
    for i in tweets_list:
        tweets_distance.append({
            "tweet":i["tweet"],
            "distance":utils.distance_from_paris_geopy(i["coordinates"])
            })
    tweets_arranged = sorted(tweets_distance, key=itemgetter('distance'))
    return tweets_arranged
Example #2
0
def tweetstream_arrange_by_distance_from_paris(tweets_list):
    """ Sorts the tweetstream list """
    tweets_distance = []
    for i,tweet in enumerate(tweets_list) :
        tweets_distance.append({
            'tweet':tweet,
            'distance':utils.distance_from_paris_geopy(tweet['coordinates']['coordinates'])
            })
    tweets_arranged = sorted(tweets_distance, key=itemgetter('distance'))
    return tweets_arranged