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:
parent
25eda807ab
commit
3cef1a463f
22 changed files with 138 additions and 72 deletions
7
core_examples/current_trends.py
Normal file
7
core_examples/current_trends.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from twython import Twython
|
||||
|
||||
""" Instantiate Twython with no Authentication """
|
||||
twitter = Twython()
|
||||
trends = twitter.getCurrentTrends()
|
||||
|
||||
print trends
|
||||
7
core_examples/daily_trends.py
Normal file
7
core_examples/daily_trends.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from twython import Twython
|
||||
|
||||
""" Instantiate Twython with no Authentication """
|
||||
twitter = Twython()
|
||||
trends = twitter.getDailyTrends()
|
||||
|
||||
print trends
|
||||
7
core_examples/get_user_timeline.py
Normal file
7
core_examples/get_user_timeline.py
Normal 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
|
||||
8
core_examples/public_timeline.py
Normal file
8
core_examples/public_timeline.py
Normal 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"]
|
||||
8
core_examples/search_results.py
Normal file
8
core_examples/search_results.py
Normal 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"]
|
||||
6
core_examples/shorten_url.py
Normal file
6
core_examples/shorten_url.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from twython import Twython
|
||||
|
||||
# Shortening URLs requires no authentication, huzzah
|
||||
shortURL = Twython.shortenURL("http://www.webs.com/")
|
||||
|
||||
print shortURL
|
||||
9
core_examples/update_profile_image.py
Normal file
9
core_examples/update_profile_image.py
Normal 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")
|
||||
13
core_examples/update_status.py
Normal file
13
core_examples/update_status.py
Normal 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?")
|
||||
7
core_examples/weekly_trends.py
Normal file
7
core_examples/weekly_trends.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from twython import Twython
|
||||
|
||||
""" Instantiate Twython with no Authentication """
|
||||
twitter = Twython()
|
||||
trends = twitter.getWeeklyTrends()
|
||||
|
||||
print trends
|
||||
Loading…
Add table
Add a link
Reference in a new issue