Check in whatever I changed in the meantime, obviously including a setup script

This commit is contained in:
Klaus-Uwe Mitterer 2016-02-08 01:55:12 +01:00
parent 7af8c609d0
commit 506cd65c70
3 changed files with 7 additions and 10 deletions

View file

@ -2,7 +2,7 @@
import tools import tools
import sqlite3, csv import sqlite3, csv, sys
def makeDB(path=tools.dbpath()): def makeDB(path=tools.dbpath()):
try: try:

View file

@ -11,7 +11,7 @@ def getTweets(mode = "@", path = tools.dbpath()):
tweets = db.executeQuery("SELECT text FROM tweets") tweets = db.executeQuery("SELECT text FROM tweets")
for tweet in tweets: for tweet in tweets:
for word in tweet[0].split(): for word in tweet[0].lower().split():
if word[0] == mode or mode == "": if word[0] == mode or mode == "":
if mode == "": if mode == "":
handle = word handle = word

View file

@ -20,13 +20,13 @@ def cke():
try: try:
return getSetting("Twitter", "cke") return getSetting("Twitter", "cke")
except: except:
return "V6ekVFYtavi6IvRFLS0dHifSh" raise SetupException()
def cse(): def cse():
try: try:
return getSetting("Twitter", "cse") return getSetting("Twitter", "cse")
except: except:
return "U2duSfBtW0Z8UQFoJyARf3jU80gdQ44EEqWqC82ebuGbIPN3t7" raise SetupException()
def ato(): def ato():
try: try:
@ -36,15 +36,12 @@ def ato():
def ase(): def ase():
try: try:
return getSetting("Twitter", "ato") return getSetting("Twitter", "ase")
except: except:
raise SetupException() raise SetupException()
def user(): def user():
try: return twObject().whoami()
return twObject().whoami()
except:
raise SetupException()
class dbObject: class dbObject:
@ -98,7 +95,7 @@ class twObject:
return tweets return tweets
def whoami(self): def whoami(self):
return self.api.me().screen_name return self.auth.get_username()
def dbCheck(db, create = False): def dbCheck(db, create = False):