Skip to content

Commit a787b67

Browse files
committed
wtwitter.py 0.3: fix mixed spaces and tabs for indentation, make script compatible with Python 3
1 parent 5c72697 commit a787b67

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

python/wtwitter.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
1111
history:
1212
13+
0.3 - fix mixed spaces and tabs for indentation, make script compatible
14+
with Python 3
15+
Sebastien Helleu <[email protected]>
16+
1317
0.2 - rename script to wtwitter.py (twitter is a python module)
1418
Sebastien Helleu <[email protected]>
1519
@@ -24,7 +28,7 @@
2428
import weechat
2529
import feedparser
2630

27-
weechat.register("wtwitter", "Jimmy Zelinskie", "0.2", "GPL3", "Sends your latest tweet to the current buffer", "", "")
31+
weechat.register("wtwitter", "Jimmy Zelinskie", "0.3", "GPL3", "Sends your latest tweet to the current buffer", "", "")
2832

2933
defaults = {
3034
"twitter_handle" : "nobody",
@@ -36,7 +40,7 @@
3640
cmd_stdout = ""
3741
cmd_stderr = ""
3842

39-
for k, v in defaults.iteritems():
43+
for k, v in defaults.items():
4044
if not weechat.config_is_set_plugin(k):
4145
weechat.config_set_plugin(k, v)
4246

@@ -55,11 +59,11 @@ def twitter_cmd(data, buffer, args):
5559
"feed = None\n"
5660
"feed = feedparser.parse('http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=%(username)s')\n"
5761
"if not feed or feed.bozo:\n"
58-
" print >>sys.stderr, 'Could not fetch Twitter RSS feed.',\n"
62+
" print >>sys.stderr, 'Could not fetch Twitter RSS feed.',\n"
5963
"elif not 'items' in feed or len(feed['items']) < 1:\n"
60-
" print >>sys.stderr, 'No tweets found in Twitter RSS feed.',\n"
64+
" print >>sys.stderr, 'No tweets found in Twitter RSS feed.',\n"
6165
"else:\n"
62-
" print '@'+feed['items'][0]['title'].replace(u'\u2013', '-').encode('utf-8', 'replace'),\n"
66+
" print '@'+feed['items'][0]['title'].replace(u'\u2013', '-').encode('utf-8', 'replace'),\n"
6367
"\"" % {"username" : weechat.config_get_plugin('twitter_handle')},
6468
10000, "twitter_cb", "")
6569
return weechat.WEECHAT_RC_OK

0 commit comments

Comments
 (0)