Redid some examples, moved examples to core_examples to differentiate from oauth_django_example, version bump to 1.3.2 to fix distribution errors with Pip/etc (dumb binaries were being created earlier, just throwing out the source now and letting pip handle it)

This commit is contained in:
Ryan McGrath 2010-10-19 16:31:09 -04:00
parent 25eda807ab
commit 3cef1a463f
22 changed files with 138 additions and 72 deletions

View file

@ -0,0 +1,7 @@
from twython import Twython
""" Instantiate Twython with no Authentication """
twitter = Twython()
trends = twitter.getCurrentTrends()
print trends

View file

@ -0,0 +1,7 @@
from twython import Twython
""" Instantiate Twython with no Authentication """
twitter = Twython()
trends = twitter.getDailyTrends()
print trends

View file

@ -0,0 +1,7 @@
from twython import Twython
# We won't authenticate for this, but sometimes it's necessary
twitter = Twython()
user_timeline = twitter.getUserTimeline(screen_name="ryanmcgrath")
print user_timeline

View file

@ -0,0 +1,8 @@
from twython import Twython
# Getting the public timeline requires no authentication, huzzah
twitter = Twython()
public_timeline = twitter.getPublicTimeline()
for tweet in public_timeline:
print tweet["text"]

View file

@ -0,0 +1,8 @@
from twython import Twython
""" Instantiate Twython with no Authentication """
twitter = Twython()
search_results = twitter.searchTwitter(q="WebsDotCom", rpp="50")
for tweet in search_results["results"]:
print tweet["text"]

View file

@ -0,0 +1,6 @@
from twython import Twython
# Shortening URLs requires no authentication, huzzah
shortURL = Twython.shortenURL("http://www.webs.com/")
print shortURL

View file

@ -0,0 +1,9 @@
from twython import Twython
"""
You'll need to go through the OAuth ritual to be able to successfully
use this function. See the example oauth django application included in
this package for more information.
"""
twitter = Twython()
twitter.updateProfileImage("myImage.png")

View file

@ -0,0 +1,13 @@
from twython import Twython
"""
Note: for any method that'll require you to be authenticated (updating things, etc)
you'll need to go through the OAuth authentication ritual. See the example
Django application that's included with this package for more information.
"""
twitter = Twython()
# OAuth ritual...
twitter.updateStatus("See how easy this was?")

View file

@ -0,0 +1,7 @@
from twython import Twython
""" Instantiate Twython with no Authentication """
twitter = Twython()
trends = twitter.getWeeklyTrends()
print trends