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

Proposed by Eduardo Mucelli Rezende Oliveira
Status: Merged
Merged at revision: 379
Proposed branch: lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Merge into: lp:~cairo-dock-third-party/cairo-dock-plug-ins-extras/third-party
Diff against target: 80 lines (+17/-13)
4 files modified
Twitter/ChangeLog (+1/-0)
Twitter/Twitter.conf (+1/-1)
Twitter/auto-load.conf (+1/-1)
Twitter/twitter.py (+14/-11)
To merge this branch: bzr merge lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/Twitter
Reviewer Review Type Date Requested Status
Matthieu Baerts Approve
Review via email: mp+179046@code.launchpad.net

Description of the change

Twitter: Updated twitter api to the version 1.1

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

Updating Twitter to the API 1.1

Revision history for this message
Eduardo Mucelli Rezende Oliveira (eduardo-mucelli) wrote :

Matttbe, are you guys still using the lastmodif file? If so, is the format YYYYMMDD or YYYYDDMM? I always forget to update it.

Revision history for this message
Matthieu Baerts (matttbe) wrote :

Hello Eduardo and thank you for these modifications ;)

It looks fine (even if I'm not able to test it right now ;) ).

We are still using 'last-modif' file but this file is managed by the dock, no need to modify it ;) (it's used to know if the dock has to update this applet or not).
But is it possible to modify the 'last-modif' entry of your Twitter applet in 'list.conf' file too? We regularly forgot it :)
Format is YYYYMMDD (this number has to be bigger each day)

Then, you can push your modifications on the main branch ;)
(or I can do that if you prefer)

Also: here is just a 2 tips/advices (mostly details):
 * About the commit message, it's maybe better to start it with the name of the applet (just "Twitter: Updating (...)") => For more advices about the commit message, please have a look there: http://www.glx-dock.org/ww_page.php?p=Help%20us%20with%20BZR&lang=en#18-About%20the%20commit%20message
 * No need to bump the version number of your applet if you don't change the .conf file (but you can do that if you want to have a detailed changelog for each modification but you can also have a version number and a lot of changes and in your ChangeLog file, you can add the date ;) )

Have a nice day,

Matt

review: Needs Fixing
Revision history for this message
Matthieu Baerts (matttbe) wrote :

Hello Eduardo,

I re-post a new comment just because I know that these mails you receive about these merge requests are not so clear (I think you already told me that you didn't see previous comments that I made here :) )

So it's just to know if you saw my previous comment :) (and if you prefer that I answer to your question on Cairo-Dock's forum, here or by e-mails)

Revision history for this message
Eduardo Mucelli Rezende Oliveira (eduardo-mucelli) wrote :

Heya! I see your comments by e-mail. Actually I misunderstood your previous comment, and neglected the list.conf change. I will do it as soon as I get back home.

The commit message ... yes, I always forget it. I end up adding the applet name only on the merge message. Anyway, I will try my best to remember next times, promised :-)

The .conf file, ok, got it. I will keep tracking inside Changelog and let the version static until I change something inside .conf.

Cheers!

Revision history for this message
Matthieu Baerts (matttbe) wrote :

Ok, thank you :)

About the commit message, yes, it's a detail, it's not so important ;) but it's just... better :P

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Twitter/ChangeLog'
--- Twitter/ChangeLog 2012-05-20 12:59:43 +0000
+++ Twitter/ChangeLog 2013-08-07 20:36:26 +0000
@@ -1,3 +1,4 @@
10.4.4 (August/7/2013): Converted twitter API to the version 1.1.
10.4.1 (May/20/2012): Added home timeline on Identi.ca.20.4.1 (May/20/2012): Added home timeline on Identi.ca.
20.4: (May/18/2012): Fully supporting individually account log-in. Code improvements, refactoring, and bug fixes.30.4: (May/18/2012): Fully supporting individually account log-in. Code improvements, refactoring, and bug fixes.
30.3: (May/13/2012): Added support to Identi.ca! Many code changes, refactoring, and improving.40.3: (May/13/2012): Added support to Identi.ca! Many code changes, refactoring, and improving.
45
=== modified file 'Twitter/Twitter.conf'
--- Twitter/Twitter.conf 2012-11-05 14:51:51 +0000
+++ Twitter/Twitter.conf 2013-08-07 20:36:26 +0000
@@ -1,4 +1,4 @@
1#0.4.31#0.4.4
22
3#[gtk-about]3#[gtk-about]
4[Icon]4[Icon]
55
=== modified file 'Twitter/auto-load.conf'
--- Twitter/auto-load.conf 2012-11-05 14:51:51 +0000
+++ Twitter/auto-load.conf 2013-08-07 20:36:26 +0000
@@ -10,7 +10,7 @@
10category = 310category = 3
1111
12# Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file.12# Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file.
13version = 0.4.313version = 0.4.4
1414
15# Whether the applet can be instanciated several times or not.15# Whether the applet can be instanciated several times or not.
16multi-instance = true16multi-instance = true
1717
=== modified file 'Twitter/twitter.py'
--- Twitter/twitter.py 2013-02-28 00:04:13 +0000
+++ Twitter/twitter.py 2013-08-07 20:36:26 +0000
@@ -101,7 +101,7 @@
101 def __init__(self, access_key, access_secret, callback):101 def __init__(self, access_key, access_secret, callback):
102 Twitter.API.__init__(self, access_key, access_secret)102 Twitter.API.__init__(self, access_key, access_secret)
103103
104 self.user_stream_url = "https://userstream.twitter.com/2/user.json"104 self.user_stream_url = "https://userstream.twitter.com/1.1/user.json"
105 self.callback = callback # called as soon as a new entry on the stream appears105 self.callback = callback # called as soon as a new entry on the stream appears
106 thread = threading.Thread(target=self.tweet_streaming) # keep checking for new entries on the stream106 thread = threading.Thread(target=self.tweet_streaming) # keep checking for new entries on the stream
107 thread.start() # run, forrest run107 thread.start() # run, forrest run
@@ -126,22 +126,25 @@
126 if len(tweets) > 1:126 if len(tweets) > 1:
127 content = tweets[0]127 content = tweets[0]
128 if "text" in content:128 if "text" in content:
129 content = simplejson.loads(content)129 try:
130 logp("Received from Twitter Stream: %s" % content)130 content = simplejson.loads(content)
131 self.callback(content) # callback == Twitter.on_receive_new_entry_into_stream_callback131 logp("Received from Twitter Stream: %s" % content)
132 self.callback(content) # callback == Twitter.on_receive_new_entry_into_stream_callback
133 except ValueError: # in some strange circumstances the content may not be a valid json
134 pass
132 buffer = tweets[1]135 buffer = tweets[1]
133 136
134 class TwitterAPI(API):137 class TwitterAPI(API):
135 def __init__(self, access_key, access_secret):138 def __init__(self, access_key, access_secret):
136 Twitter.API.__init__(self, access_key, access_secret)139 Twitter.API.__init__(self, access_key, access_secret)
137 140
138 self.update_url = 'https://api.twitter.com/1/statuses/update.json'141 self.update_url = 'https://api.twitter.com/1.1/statuses/update.json'
139 self.home_timeline_url = 'https://api.twitter.com/1/statuses/home_timeline.json'142 self.home_timeline_url = 'https://api.twitter.com/1.1/statuses/home_timeline.json'
140 self.direct_messages_url = 'https://api.twitter.com/1/direct_messages.json'143 self.direct_messages_url = 'https://api.twitter.com/1.1/direct_messages.json'
141 self.new_direct_messages_url = 'https://api.twitter.com/1/direct_messages/new.json'144 self.new_direct_messages_url = 'https://api.twitter.com/1.1/direct_messages/new.json'
142 self.verify_credentials_url = 'https://api.twitter.com/1/account/verify_credentials.json'145 self.verify_credentials_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'
143 self.user_timeline_url = 'https://api.twitter.com/1/statuses/user_timeline.json'146 self.user_timeline_url = 'https://api.twitter.com/1.1/statuses/user_timeline.json'
144 self.retweet_url_prefix = 'https://api.twitter.com/1/statuses/retweet/' # lacks the id of the tweet to be retweeted147 self.retweet_url_prefix = 'https://api.twitter.com/1.1/statuses/retweet/' # lacks the id of the tweet to be retweeted
145 148
146 def dispatch(self, url, mode, parameters={}):149 def dispatch(self, url, mode, parameters={}):
147 oauth_request = oauth.OAuthRequest.from_consumer_and_token(self.consumer,150 oauth_request = oauth.OAuthRequest.from_consumer_and_token(self.consumer,

Subscribers

People subscribed via source and target branches