mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-14 02:26:58 -07:00
Update python-twitter to 3.4.1
This commit is contained in:
parent
8e4aba7ed4
commit
f743a817ba
8 changed files with 1520 additions and 993 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import re
|
||||
|
||||
|
||||
class Emoticons:
|
||||
POSITIVE = ["*O", "*-*", "*O*", "*o*", "* *",
|
||||
":P", ":D", ":d", ":p",
|
||||
|
@ -27,6 +28,7 @@ class Emoticons:
|
|||
"[:", ";]"
|
||||
]
|
||||
|
||||
|
||||
class ParseTweet(object):
|
||||
# compile once on import
|
||||
regexp = {"RT": "^RT", "MT": r"^MT", "ALNUM": r"(@[a-zA-Z0-9_]+)",
|
||||
|
@ -51,7 +53,7 @@ class ParseTweet(object):
|
|||
self.Emoticon = ParseTweet.getAttributeEmoticon(tweet)
|
||||
|
||||
# additional intelligence
|
||||
if ( self.RT and len(self.UserHandles) > 0 ): # change the owner of tweet?
|
||||
if (self.RT and len(self.UserHandles) > 0): # change the owner of tweet?
|
||||
self.Owner = self.UserHandles[0]
|
||||
return
|
||||
|
||||
|
@ -66,10 +68,10 @@ class ParseTweet(object):
|
|||
emoji = list()
|
||||
for tok in re.split(ParseTweet.regexp["SPACES"], tweet.strip()):
|
||||
if tok in Emoticons.POSITIVE:
|
||||
emoji.append( tok )
|
||||
emoji.append(tok)
|
||||
continue
|
||||
if tok in Emoticons.NEGATIVE:
|
||||
emoji.append( tok )
|
||||
emoji.append(tok)
|
||||
return emoji
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue