mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Play a sound when a tweet contains images
This commit is contained in:
parent
cc60235503
commit
146667144a
@ -595,6 +595,8 @@ class baseBufferController(bufferController):
|
||||
self.session.sound.play("audio.ogg")
|
||||
if utils.is_geocoded(tweet):
|
||||
self.session.sound.play("geo.ogg")
|
||||
if utils.is_media(tweet):
|
||||
self.session.sound.play("image.ogg")
|
||||
|
||||
# @_tweets_exist
|
||||
def audio(self, url='', *args, **kwargs):
|
||||
|
BIN
src/sounds/default/image.ogg
Normal file
BIN
src/sounds/default/image.ogg
Normal file
Binary file not shown.
@ -66,6 +66,14 @@ def is_geocoded(tweet):
|
||||
if tweet.has_key("coordinates") and tweet["coordinates"] != None:
|
||||
return True
|
||||
|
||||
def is_media(tweet):
|
||||
if tweet["entities"].has_key("media") == False:
|
||||
return False
|
||||
for i in tweet["entities"]["media"]:
|
||||
if i.has_key("type") and i["type"] == "photo":
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_all_mentioned(tweet, conf, field="screen_name"):
|
||||
""" Gets all users that has been mentioned."""
|
||||
results = []
|
||||
|
@ -106,7 +106,7 @@ class generalAccount(wx.Panel, baseDialog.BaseWXDialog):
|
||||
rMode.Add(lbl, 0, wx.ALL, 5)
|
||||
rMode.Add(self.retweet_mode, 0, wx.ALL, 5)
|
||||
sizer.Add(rMode, 0, wx.ALL, 5)
|
||||
self.show_screen_names = wx.CheckBox(self, wx.NewId(), _(U"Show screen names instead full names"))
|
||||
self.show_screen_names = wx.CheckBox(self, wx.NewId(), _(U"Show screen names instead of full names"))
|
||||
sizer.Add(self.show_screen_names, 0, wx.ALL, 5)
|
||||
PersistSizeLabel = wx.StaticText(self, -1, _(u"Number of items per buffer to cache in database (0 to disable caching, blank for unlimited)"))
|
||||
self.persist_size = wx.TextCtrl(self, -1)
|
||||
|
Loading…
Reference in New Issue
Block a user