diff --git a/datecsv.sh b/datecsv.sh index 5f2aeb3..17af6e3 100755 --- a/datecsv.sh +++ b/datecsv.sh @@ -1,7 +1,6 @@ #!/bin/bash DATAFILE=Database.db -OUTFILE=output.csv SQLITE="sqlite3 -csv -header" @@ -13,4 +12,4 @@ done QUERY="$QUERY FROM tweets t GROUP BY SUBSTR(t.timestamp,0,11);" -$SQLITE $DATAFILE "$QUERY" > $OUTFILE +$SQLITE $DATAFILE "$QUERY" diff --git a/gethandles.py b/gethandles.py index 75533f4..f246c10 100755 --- a/gethandles.py +++ b/gethandles.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- import operator, re, sqlite3 @@ -23,6 +23,6 @@ def getTweets(database_filename = "Database.db"): return handles if __name__ == "__main__": - data = sorted(getTweets().items(), key=operator.itemgetter(1), reverse=True) + data = sorted(list(getTweets().items()), key=operator.itemgetter(1), reverse=True) for handle, tweets in data: - print handle + "," + str(tweets) + print(handle + "," + str(tweets))