In [1]:
from IPython.display import display, Image, HTML

django-wham demo

Twitter: get my latest tweets


In [2]:
djangomelb = TwitterUser.objects.get(screen_name='mbylstra')
for tweet in djangomelb.tweets.all()[:5]:   
    display(tweet)


https://api.twitter.com/1.1/users/show.json?screen_name=mbylstra
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&exclude_replies=true&user_id=203788575&include_rts=false

This should hopefully show up in my @DjangoConAU #djangowham demo. Please stop using the internet for a sec.

0 retweets


I got round to writing a little documentation for django-wham https://t.co/TP7Xw3Ct5K

0 retweets


doing a live demo of django-wham (https://t.co/TP7Xw3Ct5K) at @MelbDjango . did it work?

3 retweets


Not possible to jam with someone in another country without soundblasterlike 50ms lag. Light's too slow. That's lame. http://t.co/6spMjUEDz3

0 retweets


new ratings of front end frameworks after spending a day with React. React: 9/10, Angular: 2/10, Backbone: 5/10.

0 retweets

sort @melbdjango tweets by retweet count

In [3]:
djangocon = TwitterUser.objects.get(screen_name='DjangoConAU')
for tweet in djangocon.tweets.all().order_by('-retweet_count')[:5]:   
    display(tweet)


https://api.twitter.com/1.1/users/show.json?screen_name=DjangoConAU
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&exclude_replies=true&user_id=1256563502&include_rts=false

EMERGENCY CALL FOR PAPERS: A speaker has withdrawn from DjangoCon AU, backups have fallen through. Let us know if you can fill a 30min slot.

26 retweets


Women's DjangoCon AU shirts still need some help: 13 sales needed to confirm the order. Spread the word! http://t.co/OpFp6Uktdi

11 retweets


We're excited to announce that @kcunning will be keynoting @djangoconau as well as @pyconau!

11 retweets


Our closing keynote speaker will be @dibblego - talking about what the Django community can learn from functional programming

11 retweets


Announcing: Australia's first gathering of #django developers -- DjangoCon AU, July 5, prior to PyConAU July 6-7 https://t.co/gQUkEbBDaF

10 retweets

this time fetch multiple pages from the Twitter API first

In [4]:
devops_borat = TwitterUser.objects.get(screen_name='DEVOPS_BORAT')
for tweet in devops_borat.tweets.all(wham_pages='all').order_by('-retweet_count')[:5]:   
    display(tweet)


https://api.twitter.com/1.1/users/show.json?screen_name=DEVOPS_BORAT
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&exclude_replies=true&user_id=167499429&include_rts=false
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&user_id=167499429&exclude_replies=true&max_id=224215058849349633&include_rts=false
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&user_id=167499429&exclude_replies=true&max_id=167097933437734912&include_rts=false
https://api.twitter.com/1.1/statuses/user_timeline.json?count=200&user_id=167499429&exclude_replies=true&max_id=138823370774032384&include_rts=false

Big Data is any thing which is crash Excel.

2101 retweets


Word "impossible" is not exist in devops vocabulary. Instead we are use "done by Q4".

1633 retweets


Junior programmer is everybody can able understand your code is wrong. Senior programmer is nobody can able understand your code is wrong.

1164 retweets


Software project 1) On time 2) On budget 3) With quality. You can not able pick any.

1072 retweets


In devops we are face fiscal cliff every year when Oracle license is up for renew.

949 retweets

Spotify

search for artists using filter(name__icontains=...)

In [ ]:
for artist in SpotifyArtist.objects.filter(name__icontains='django')[:10]:
    print artist.name
sort albums by popularity

In [ ]:
artist = SpotifyArtist.objects.filter(name__icontains='radiohead')[0]
for album in artist.albums.all().order_by('-popularity')[:20]:
    print 'popularity: ', album.popularity, ' album:', album.name
this time use wham_depth=2 to get popularity data first

In [ ]:
artist = SpotifyArtist.objects.filter(name__icontains='radiohead')[0]
for album in artist.albums.all(wham_depth=2).order_by('-popularity')[:20]:
    print 'popularity: ', album.popularity, ' album:', album.name

Endpoint/Model documentation


In [ ]:
Tweet.objects

In [ ]:
SpotifyAlbum.objects

In [ ]: