ShowTweets

Description

Displays twitter messages (aka tweets) from a users timeline.

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

ShowTweets.py

0.6.1

1.9.7

now only python-tweepy needed for dependencies, but works only with python 2.6 / 2.7 (tweepy disabled 2.5 support)

ShowTweets-0.4.py

0.4 (ALPHA)

1.8.x / 1.9.x

pep8 and tested with 1.9

ShowTweets-0.3.py

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

ShowTweets-0.1.py

0.1 (ALPHA)

1.8.x

be aware; this is an alpha version and not everything is done

Dependencies:

Initial Configuration

Since twitter requires OAUTH, you have to register this "macro" on twitter:

and configure those into your macro ShowTweets.py:

   1 #OAUTH configuration (you have to configure this!)
   2     consumer_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
   3     consumer_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
   4     access_token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
   5     access_token_secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
   6     auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
   7     auth.set_access_token(access_token, access_token_secret)

Parameters

Optional macro parameters are:

Security

Be aware that if you configure & use this macro on a "public" wiki, other users can access (with your credentials!!!) other twitter acounts. To avoid this you can add a fixed username, e.g somewhere in the #Initial stuff area, like:

   1 user = "<twitteraccount>"

Example

To display the tweets from the User "twitter" do this:

<<ShowTweets("twitter")>>

screenshot how it could look:

output_tweets.png

2009, 2010, 2013 by MarcelHäfner (http://moinmo.in/MarcelHäfner) / GNU GPL, see COPYING for details.

Licences for dependencies:

Bugs

Discussion


2010-05-19: Tipps

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

many thanks for you tricks & tipps -- MarcelHäfner 2010-05-20 23:44:59

The date and time of the Tweets are always the date and time of the top entry. The index of statuses in line 115 should be tweetCount. The variable tweetNumber in line 78 is unused then and can be deleted. ;-) -- DirkAlders 2014-01-18 15:41:17

Patch for tweepy

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 2024-12-23 03:41:11 (./) integrated, thanks


MoinMoin: MacroMarket/ShowTweets (last edited 2014-01-18 16:49:47 by DirkAlders)