diff --git a/getmentions.py b/getmentions.py index b68d765..cc7391c 100755 --- a/getmentions.py +++ b/getmentions.py @@ -13,8 +13,11 @@ def getTweets(mode = "@", path = tools.config.dbpath): for tweet in tweets: for word in tweet[0].split(): - if word[0] == mode: - handle = mode + re.split('[\\W]',word[1:])[0].lower() + if word[0] == mode or mode == "": + if mode == "": + handle = word + else: + handle = mode + re.split('[\\W]',word[1:])[0].lower() if handle != mode: try: handles[handle] += 1 @@ -34,6 +37,8 @@ if __name__ == "__main__": for arg in sys.argv[1:]: if arg == "-h": mode = "#" + if arg == "-w": + mode = "" else: path = arg