Merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter into lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party

Proposed by Eduardo Mucelli Rezende Oliveira
Status: Merged
Merged at revision: 235
Proposed branch: lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Merge into: lp:~cairo-dock-team/cairo-dock-plug-ins-extras/third-party
Diff against target: 43 lines (+8/-7)
1 file modified
Twitter/Twitter (+8/-7)
To merge this branch: bzr merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Reviewer Review Type Date Requested Status
Cairo-Dock Devs Pending
Review via email: mp+96261@code.launchpad.net

Description of the change

Do not include on the notifications tweets made by the own user

To post a comment you must log in.
235. By Eduardo Mucelli Rezende Oliveira

Not include on the notifications tweets made by the own user

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Twitter/Twitter'
--- Twitter/Twitter 2012-03-06 15:51:05 +0000
+++ Twitter/Twitter 2012-03-06 23:00:28 +0000
@@ -27,7 +27,7 @@
27# To see the received direct messages right-click on the icon -> Twitter -> Received direct messages27# To see the received direct messages right-click on the icon -> Twitter -> Received direct messages
28# To see some user's info right-click on the icon -> Twitter -> Info28# To see some user's info right-click on the icon -> Twitter -> Info
2929
30import urlparse, os, webbrowser, simplejson, threading, Queue, time, urllib2, simplejson30import urlparse, os, webbrowser, simplejson, threading, Queue, time, urllib2
31from oauth import oauth31from oauth import oauth
32from http import post, get #, stream32from http import post, get #, stream
33from util import *33from util import *
@@ -91,8 +91,8 @@
9191
92 self.user_stream_url = "https://userstream.twitter.com/2/user.json"92 self.user_stream_url = "https://userstream.twitter.com/2/user.json"
93 self.callback = callback # this method is going to be called as soon as a new entry on the stream appears93 self.callback = callback # this method is going to be called as soon as a new entry on the stream appears
94 thread = threading.Thread(target=self.tweet_streaming)94 thread = threading.Thread(target=self.tweet_streaming) # keep checking for new entries on the stream
95 thread.start()95 thread.start() # run, forrest run
9696
97 def tweet_streaming(self):97 def tweet_streaming(self):
98 oauth_request = oauth.OAuthRequest.from_consumer_and_token(self.consumer,98 oauth_request = oauth.OAuthRequest.from_consumer_and_token(self.consumer,
@@ -187,14 +187,15 @@
187187
188 # Twitter methods188 # Twitter methods
189189
190 # TODO: Make available a "Animation" option upon a new tweet arrival
191 # This method is a callback that is called as soon as a new tweet that arrives on the stream190 # This method is a callback that is called as soon as a new tweet that arrives on the stream
192 # It is passed as parameter when creating the instance for the TwitterStreamAPI191 # It is passed as parameter when creating the instance for the TwitterStreamAPI
193 # TwitterStreamAPI(access_key, access_secret, self.on_receive_new_tweet_callback)192 # TwitterStreamAPI(access_key, access_secret, self.on_receive_new_tweet_callback)
193 # TODO: Make available an "Animation" option upon a new tweet arrival
194 def on_receive_new_tweet_callback(self, tweet):194 def on_receive_new_tweet_callback(self, tweet):
195 logp("Inserting new tweet on the stream Queue: %s" % tweet)195 if 'screen_name' in tweet and not (tweet['screen_name'] == self.user.screen_name):
196 self.stream.put(tweet) # put the new tweet on the stream queue196 logp("Inserting new tweet on the stream Queue: %s" % tweet) # not sent by the own user
197 self.icon.SetQuickInfo(str(self.stream.qsize())) # update the new tweets counter on the icon197 self.stream.put(tweet) # put the new tweet on the stream queue
198 self.icon.SetQuickInfo(str(self.stream.qsize())) # update the new tweets counter on the icon
198199
199 def show_new_tweets(self):200 def show_new_tweets(self):
200 self.inform_start_of_waiting_process()201 self.inform_start_of_waiting_process()

Subscribers

People subscribed via source and target branches