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
1=== modified file 'Twitter/Twitter'
2--- Twitter/Twitter 2012-03-06 15:51:05 +0000
3+++ Twitter/Twitter 2012-03-06 23:00:28 +0000
4@@ -27,7 +27,7 @@
5 # To see the received direct messages right-click on the icon -> Twitter -> Received direct messages
6 # To see some user's info right-click on the icon -> Twitter -> Info
7
8-import urlparse, os, webbrowser, simplejson, threading, Queue, time, urllib2, simplejson
9+import urlparse, os, webbrowser, simplejson, threading, Queue, time, urllib2
10 from oauth import oauth
11 from http import post, get #, stream
12 from util import *
13@@ -91,8 +91,8 @@
14
15 self.user_stream_url = "https://userstream.twitter.com/2/user.json"
16 self.callback = callback # this method is going to be called as soon as a new entry on the stream appears
17- thread = threading.Thread(target=self.tweet_streaming)
18- thread.start()
19+ thread = threading.Thread(target=self.tweet_streaming) # keep checking for new entries on the stream
20+ thread.start() # run, forrest run
21
22 def tweet_streaming(self):
23 oauth_request = oauth.OAuthRequest.from_consumer_and_token(self.consumer,
24@@ -187,14 +187,15 @@
25
26 # Twitter methods
27
28- # TODO: Make available a "Animation" option upon a new tweet arrival
29 # This method is a callback that is called as soon as a new tweet that arrives on the stream
30 # It is passed as parameter when creating the instance for the TwitterStreamAPI
31 # TwitterStreamAPI(access_key, access_secret, self.on_receive_new_tweet_callback)
32+ # TODO: Make available an "Animation" option upon a new tweet arrival
33 def on_receive_new_tweet_callback(self, tweet):
34- logp("Inserting new tweet on the stream Queue: %s" % tweet)
35- self.stream.put(tweet) # put the new tweet on the stream queue
36- self.icon.SetQuickInfo(str(self.stream.qsize())) # update the new tweets counter on the icon
37+ if 'screen_name' in tweet and not (tweet['screen_name'] == self.user.screen_name):
38+ logp("Inserting new tweet on the stream Queue: %s" % tweet) # not sent by the own user
39+ self.stream.put(tweet) # put the new tweet on the stream queue
40+ self.icon.SetQuickInfo(str(self.stream.qsize())) # update the new tweets counter on the icon
41
42 def show_new_tweets(self):
43 self.inform_start_of_waiting_process()

Subscribers

People subscribed via source and target branches