Compare commits

...

9 Commits

Author SHA1 Message Date
bb4869b7be Pushed a new snapshot 2021-07-04 17:05:06 -05:00
44b6e82183 Fix reply dialog issue 2021-07-04 11:50:03 -05:00
Jose Manuel Delicado
5268f166f8 Use Python 3.8.10 for automated builds 2021-07-04 18:43:33 +02:00
Jose Manuel Delicado
37ad6b5fbf paths.py: replace socializer by TW Blue in data_path function definition 2021-07-04 18:32:17 +02:00
Jose Manuel Delicado
bcc72c932d Updated Windows dependencies. Python 3.8.10 2021-07-04 18:26:49 +02:00
b9a9bd03c2 Pushed a new snapshot 2021-07-04 09:47:33 -05:00
e6543bcf77 Allow streaming API support to be disabled from global settings dialog 2021-07-04 09:44:48 -05:00
03b61946f8 Fixed user searches 2021-07-04 09:43:53 -05:00
8fe2f4c64d Exclude muted users from Streaming API 2021-07-04 09:15:04 -05:00
10 changed files with 42 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ snapshot32:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME}"
- choco install python --version 3.8.7 -y -ForceX86
- choco install python --version 3.8.10 -y -ForceX86
- '&$env:PYTHON -V'
- '&$env:PYTHON -m pip install --upgrade pip'
- '&$env:PYTHON -m pip install --upgrade -r requirements.txt'
@@ -54,7 +54,7 @@ snapshot64:
- Set-Variable -Name "time" -Value (date -Format "%H:%m")
- echo ${time}
- echo "started by ${GITLAB_USER_NAME}"
- choco install python --version 3.8.7 -y
- choco install python --version 3.8.10 -y
- '&$env:PYTHON -V'
- '&$env:PYTHON -m pip install --upgrade pip'
- '&$env:PYTHON -m pip install --upgrade -r requirements.txt'

View File

@@ -15,10 +15,10 @@ SetCompressor /solid lzma
SetDatablockOptimize on
VIAddVersionKey ProductName "TWBlue Snapshot version"
VIAddVersionKey LegalCopyright "Copyright 2014-2021 Manuel Cortéz."
VIAddVersionKey ProductVersion "7"
VIAddVersionKey FileVersion "7"
VIProductVersion "7.0.0.0"
VIFileVersion "7.0.0.0"
VIAddVersionKey ProductVersion "9"
VIAddVersionKey FileVersion "9"
VIProductVersion "9.0.0.0"
VIFileVersion "9.0.0.0"
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "license.txt"
@@ -72,8 +72,8 @@ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "D
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "InstallLocation" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "Publisher" "Manuel Cortéz"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "DisplayVersion" "7"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "URLInfoAbout" "http://twblue.es"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "DisplayVersion" "9"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "URLInfoAbout" "https://twblue.es"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "VersionMajor" 0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "VersionMinor" 0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "NoModify" 1

View File

@@ -9,7 +9,7 @@ if snapshot == False:
update_url = 'https://twblue.es/updates/stable.php'
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/stable.json'
else:
version = "7"
version = "9"
update_url = 'https://twblue.es/updates/snapshot.php'
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/snapshots.json'
authors = ["Manuel Cortéz", "José Manuel Delicado"]

View File

@@ -440,7 +440,7 @@ class Controller(object):
log.error("A buffer for the %s search term is already created. You can't create a duplicate buffer." % (term,))
return
elif dlg.get("users") == True:
search = buffers.twitter.SearchBuffer(self.view.nb, "search_users", "%s-searchUser" % (term,), buffer.session, buffer.session.db["user_name"], bufferType=None, sound="search_updated.ogg", q=term)
search = buffers.twitter.SearchPeopleBuffer(self.view.nb, "search_users", "%s-searchUser" % (term,), buffer.session, buffer.session.db["user_name"], bufferType=None, sound="search_updated.ogg", q=term)
search.start_stream(mandatory=True)
pos=self.view.search("searches", buffer.session.db["user_name"])
self.insert_buffer(search, pos)

View File

@@ -39,7 +39,7 @@ def logs_path():
os.mkdir(path)
return path
def data_path(app_name='socializer'):
def data_path(app_name='TW Blue'):
if platform.system() == "Windows":
data_path = os.path.join(os.getenv("AppData"), app_name)
else:

View File

@@ -504,13 +504,18 @@ class Session(base.baseSession):
self.db["users"] = users
def start_streaming(self):
self.stream_listener = streaming.StreamListener(twitter_api=self.twitter, user=self.db["user_name"], user_id=self.db["user_id"])
if config.app["app-settings"]["no_streaming"]:
return
self.stream_listener = streaming.StreamListener(twitter_api=self.twitter, user=self.db["user_name"], user_id=self.db["user_id"], muted_users=self.db["muted_users"])
self.stream = streaming.Stream(auth = self.auth, listener=self.stream_listener, chunk_size=1025)
self.stream_thread = call_threaded(self.stream.filter, follow=self.stream_listener.users, stall_warnings=True)
def stop_streaming(self):
self.stream.running = False
log.debug("Stream stopped for accounr {}".format(self.db["user_name"]))
if config.app["app-settings"]["no_streaming"]:
return
if hasattr(self, "stream"):
self.stream.running = False
log.debug("Stream stopped for accounr {}".format(self.db["user_name"]))
def handle_new_status(self, status, user):
""" Handles a new status present in the Streaming API. """
@@ -555,6 +560,10 @@ class Session(base.baseSession):
pub.sendMessage("newTweet", data=status, user=self.db["user_name"], _buffers=buffers_to_send)
def check_streams(self):
if config.app["app-settings"]["no_streaming"]:
return
if not hasattr(self, "stream"):
return
log.debug("Status of running stream for user {}: {}".format(self.db["user_name"], self.stream.running))
if self.stream.running == False:
self.start_streaming()

View File

@@ -14,14 +14,23 @@ log = logging.getLogger("sessions.twitter.streaming")
class StreamListener(tweepy.StreamListener):
def __init__(self, twitter_api, user, user_id, *args, **kwargs):
def __init__(self, twitter_api, user, user_id, muted_users=[], *args, **kwargs):
super(StreamListener, self).__init__(*args, **kwargs)
log.debug("Starting streaming listener for account {}".format(user))
self.started = False
self.users = []
self.api = twitter_api
self.user = user
self.user_id = user_id
self.users = [str(id) for id in self.api.friends_ids()]
friends = self.api.friends_ids()
log.debug("Retrieved {} friends to add to the streaming listener.".format(len(friends)))
self.users.append(str(self.user_id))
log.debug("Started streaming object for user {}".format(self.user))
log.debug("Got {} muted users.".format(len(muted_users)))
for user in friends:
if user not in muted_users:
self.users.append(str(user))
self.started = True
log.debug("Streaming listener started with {} users to follow.".format(len(self.users)))
def on_connect(self):
pub.sendMessage("streamConnected", user=self.user)

View File

@@ -121,9 +121,9 @@ def get_all_mentioned(tweet, conf, field="screen_name"):
""" Gets all users that have been mentioned."""
results = []
if hasattr(tweet, "retweeted_status"):
results.extend(get_all_mentionned(tweet.retweeted_status, conf, field))
results.extend(get_all_mentioned(tweet.retweeted_status, conf, field))
if hasattr(tweet, "quoted_status"):
results.extend(tweet.quoted_status, conf, field)
results.extend(get_all_mentioned(tweet.quoted_status, conf, field))
if hasattr(tweet, "entities") and tweet.entities.get("user_mentions"):
for i in tweet.entities["user_mentions"]:
if i["screen_name"] != conf["user_name"] and i["id_str"] != tweet.user:
@@ -168,7 +168,7 @@ def is_allowed(tweet, settings, buffer_name):
tweet_data = {}
if hasattr(tweet, "retweeted_status"):
tweet_data["retweet"] = True
if tweet.in_reply_to_status_id != None:
if hasattr(tweet, "in_reply_to_status_id"):
tweet_data["reply"] = True
if hasattr(tweet, "quoted_status"):
tweet_data["quote"] = True

View File

@@ -1,7 +1,7 @@
{"current_version": "7",
{"current_version": "8",
"description": "Snapshot version.",
"date": "unknown",
"downloads":
{"Windows32": "https://twblue.es/pubs/twblue_snapshot_x86.zip"},
{"Windows64": "https://twblue.es/pubs/twblue_snapshot_x64.zip"}
{"Windows32": "https://twblue.es/pubs/twblue_snapshot_x86.zip",
{"Windows64": "https://twblue.es/pubs/twblue_snapshot_x64.zip"
}