Contents
ShowTweets
Description
Displays twitter messages (aka tweeds) from a user as a bullet list
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
0.4 (ALPHA) |
1.8.x / 1.9.x |
pep8 and tested with 1.9 |
|
0.3 (ALPHA) |
1.8.x |
adding date, addedd css_class, optimized maxTweets, optimizing error oupput, render tweet as wiki text, added simple basic caching |
|
0.1 (ALPHA) |
1.8.x |
be aware; this is an alpha version and not everything is done |
Dependencies:
Python wrapper around the Python API (Python-Twitter): http://code.google.com/p/python-twitter/
JSON encoder/decoder for Python (simplejson) http://pypi.python.org/pypi/simplejson
Usage
Macro Parameters are:
user = UserName of a Twitter Account
- maxTweets = how many tweets should be displayed (default 10)
Authentication:
check out in the sourcecode the username and password to use your own twitter account for fetching the tweets (is neccessary if the user is private). if somebody else could read your macro, check file system permissions, high security risk!
Example: api = twitter.Api(username='username', password='password')
Example
To display the tweets from the User "twitter" do this:
<<ShowTweets("twitter")>>screenshot how it could look:
Copyright
2009, 2010 by MarcelHäfner (http://moinmo.in/MarcelHäfner)
License
GNU GPL, see COPYING for details.
Licences for dependencies:
- Python-Twitter is under Apache License, Version 2.0
- simplejson is under MIT License
ToDo
Some ideas what could be done:
Better caching for the displayed tweets: http://apiwiki.twitter.com/Rate-limiting)
Authentication without cleartext passwd: http://apiwiki.twitter.com/OAuth-FAQ
- Better error handling for the urllib, not depending on sys and socket stuff or atleast optimize the try and except stuff
Or also maybe switch to an other python twitter-api library like Tweepy with caching support, etcetera.
Bugs
Discussion
Hi folks; just wanted to try out how this could work, you see under "ToDo" what everything need to be done. question - just ask, thx -- MarcelHäfner 2009-10-18 22:55:48
Hi
cool, we should have had that too for our python bar camp. But we will for the next one. It needs some little more work
Please have a look at the indenting.
fixed
looks strange because of def macro_ShowTweets(macro, user=u"Twitter",maxTweets=10, debug=False) it is user, or?
user = twitter user account
api = twitter.Api(username=username,.. won't work too
removed, and added a note how to activate
if debug == False: if not debug:
not needed
Please escape also the content of the tweet.
sure
cheers
-- ReimarBauer 2010-05-19 16:47:13
many thanks for you tricks & tipps -- MarcelHäfner 2010-05-20 23:44:59
My patch to fix this by switching from python-twitter to tweepy: http://pastebin.com/ZnX2qJsf and add an option to hide @replies from results. -- FelixYan 2012-05-26 09:12:41
