|
|
@ -61,6 +61,7 @@ _log = logging.getLogger('mitterlib.network.Twitter') |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
# ---------------------------------------------------------------------- |
|
|
|
_month_names = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', |
|
|
|
_month_names = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', |
|
|
|
'Sep', 'Oct', 'Nov', 'Dec'] |
|
|
|
'Sep', 'Oct', 'Nov', 'Dec'] |
|
|
|
|
|
|
|
_punctuation = string.punctuation.replace('_', '') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _unhtml(text): |
|
|
|
def _unhtml(text): |
|
|
@ -173,10 +174,10 @@ class TwitterNetworkData(NetworkData): |
|
|
|
self.message = _unhtml(data['text']) |
|
|
|
self.message = _unhtml(data['text']) |
|
|
|
|
|
|
|
|
|
|
|
# regular expression for users |
|
|
|
# regular expression for users |
|
|
|
self.user_regexp = r'@[^ ' + string.punctuation + ']' |
|
|
|
self.user_regexp = r'@[^ ' + _punctuation + ']+' |
|
|
|
|
|
|
|
|
|
|
|
# regular expression for hashtags |
|
|
|
# regular expression for hashtags |
|
|
|
self.tag_regexp = r'#[^ ' + string.punctuation + ']' |
|
|
|
self.tag_regexp = r'#[^ ' + _punctuation + ']+' |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|