cas portsmouth hub meeting - 28012015

17
CodeFurther.. [email protected] www.codefurther.org @dannygoodall © Danny Goodall - 2015 Danny Goodall CAS Portsmouth Hub Meeting Introduction to the CodeFurther initiative

Upload: codefurther

Post on 07-Aug-2015

106 views

Category:

Software


0 download

TRANSCRIPT

CodeFurther...

[email protected]

@dannygoodall

© Danny Goodall - 2015

Danny Goodall

CAS Portsmouth Hub Meeting

Introduction to the CodeFurther initiative

CodeFurther...

Examples of projects…

• Display the PREMIER LEAGUE football table!

• Get the WEATHER FORECAST for tomorrow…and send it in an EMAIL to someone!

• Get a list of the most popular SONGS at the moment and send a TWEET about it!

• Get SONG LYRICS for your favourite song, and send a TEXT to a mobile phone!

CodeFurther...

Time for a…

DEMO

CodeFurther...

Example Code - Directions1. Head south on Stamshaw Rd/A3 toward Derby Rd (0.4 km / 1 min)2. At the roundabout, take the 4th exit onto the M275 ramp to M27 (0.7…3. Merge onto M275 (2.0 km / 1 min)4. At junction 12, exit toward Southampton/Fareham (0.7 km / 1 min)5. Merge onto M27 (17.5 km / 10 mins)6. At junction 8, take the A3024 exit to Southampton/East Docks/Hamble…7. At the roundabout, take the 1st exit onto A3024 (0.4 km / 1 min)8. At the roundabout, take the 3rd exit onto Bursledon Rd/A3024 (0.9 km…9. Turn left onto Botley Rd/B3033 (1.5 km / 2 mins10. At the roundabout, take the 2nd exit onto Portsmouth Rd/A3025…11. Turn left onto Terminus Terrace/A33 (78 m / 1 min)12. Turn right onto Bernard St/A33 (0.1 km / 1 min)13. Turn right onto Threefield Ln/A33 (0.2 km / 1 min)14. Slight left onto Evans St/A33 (0.2 km / 1 min)15. Take the 1st left onto Houndwell Pl (0.2 km / 1 min)16. At the roundabout, take the 3rd exit onto Palmerston Rd (0.3 km /…17. Turn left onto Pound Tree Rd (0.2 km / 1 min)18. Pound Tree Rd turns right and becomes Above Bar St (0.5 km / 2 mins)

from codefurther.directions import GetDirections

directions = GetDirections( 'Portsmouth', 'Southampton', 'driving‘)

for step in directions.steps: print(step)

CodeFurther...

Example Code - FootballPremier League 2014/15 - Matchday 22 # Team Plyd GlsF GlsA GD Pts -- ------------------------------ ---- ---- ---- ---- ---- 1 Chelsea FC 22 51 19 32 52 2 Manchester City FC 22 45 22 23 47 3 FC Southampton 22 37 16 21 42 4 Manchester United FC 22 36 21 15 40 5 FC Arsenal London 22 39 25 14 39 6 Tottenham Hotspur FC 22 32 30 2 37 7 West Ham United FC 22 35 25 10 36 8 Liverpool FC 22 31 27 4 35 9 Swansea City 22 26 30 -4 3010 Stoke City FC 22 23 27 -4 2911 Newcastle United 22 26 35 -9 2712 Everton FC 22 30 34 -4 2313 Crystal Palace 22 25 33 -8 2314 West Bromwich Albion 22 20 29 -9 2215 Aston Villa FC 22 11 25 -14 2216 Sunderland AFC 22 19 33 -14 2017 FC Burnley 22 21 36 -15 2018 Hull City FC 22 20 30 -10 1919 Queens Park Rangers 22 23 39 -16 1920 Leicester City 22 20 34 -14 17

from codefurther.football import premier_league

for league_entry in premier_league.league_table: print(league_entry)

CodeFurther...

Example Code - LyricsWhen your legs don't work like they used to beforeAnd I can't sweep you off of your feetWill your mouth still remember the taste of my loveWill your eyes still smile from your cheeksAnd darling I will be loving you till we're 70And baby my heart could still fall as hard at 23And I'm thinking 'bout how people fall in love in mysterious waysMaybe just the touch of a handOh me I fall in love with you every single dayAnd I just wanna tell you I amSo honey nowTake me into your loving armsKiss me under the light of a thousand starsPlace your head on my beating heartI'm thinking out loudThat maybe we found love right where we are

When my hair's overgone and my memory fadesAnd the crowds don't remember my nameWhen my hands don't play the strings the same wayI know you will still love me the same'Cause honey your soul can never grow oldIt's ever greenBaby your smile forever in my mind and memoryAnd I'm thinking 'bout how people fall in love in mysterious waysMaybe it's all part of a planI'll just keep on making the same mistakesHoping that you'll understandBut baby now

.

.

.

from codefurther.lyrics import Lyrics

lyrics = Lyrics()

result = lyrics.song_lyrics( "Ed Sheeran", "Thinking out loud“)

for line in result: print(line)

CodeFurther...

Example Code – Top40 Charts 1 Uptown Funk (feat. Bruno Mars) Mark Ronson 7 1 2 Lips Are Movin Meghan Trainor 7 50 3 Take Me To Church Hozier 26 3 4 Wish You Were Mine Philip George 4 2 5 Up (feat. Demi Lovato) Olly Murs 9 4 6 Thinking Out Loud Ed Sheeran 31 5 7 Heroes (We Could Be) (feat. Tove Lo) Alesso 5 7 8 The Nights Avicii 3 16 9 Blank Space Taylor Swift 13 610 Something I Need Ben Haenow 6 811 Elastic Heart Sia 7 1312 Like I Can Sam Smith 14 1013 Real Love Clean Bandit & Jess Glynne 10 1214 All About That Bass Meghan Trainor 21 1115 I Loved You (feat. Melissa Steel) Blonde 8 1516 Outside (feat. Ellie Goulding) Calvin Harris 12 1417 Cool Kids Echosmith 8 2818 Promesses (feat. Kaleem Taylor) Tchami 3 919 Shake It Off Taylor Swift 23 2620 Budapest George Ezra 39 1721 I'm Not The Only One Sam Smith 28 2122 Chandelier Sia 30 1923 Dangerous (feat. Sam Martin) David Guetta 10 2224 Blame It On Me George Ezra 29 2525 Night Changes One Direction 11 1826 Wrapped Up (feat. Travie McCoy) Olly Murs 10 2027 Stay With Me Sam Smith 36 2428 Bang Bang Jessie J, Ariana Grande & Nicki Minaj 18 2329 Hold Back The River James Bay 9 3130 These Days Take That 9 2731 Don't Tell 'Em (feat. Y.G.) Jeremih 16 3232 Don't Ed Sheeran 31 2933 All Of Me John Legend 54 3334 Steal My Girl One Direction 15 3035 Sing Ed Sheeran 34 3536 Changing (feat. Paloma Faith) Sigma 21 3737 Blame (feat. John Newman) Calvin Harris 20 3638 Prayer In C (Robin Schulz Remix) Lilly Wood 24 3839 7/11 Beyoncé 9 3440 Rather Be (feat. Jess Glynne) Clean Bandit 53 39

from codefurther.top40 import Top40

top40 = Top40()

for single in top40.singles: print(single)

CodeFurther...

Example Code – Weather ForecastTomorrow's forecast for Portsmouth, UK is Drizzle in the morning. The temperature will be between 3.14 and 7.86.

from codefurther.weather import Weather

forecast = Weather()

tomorrows_weather = forecast.tomorrow( "Portsmouth, UK“)

print(tomorrows_weather)

CodeFurther...

Example Code – Weather Forecast

from codefurther.weather import Weatherfrom codefurther.textmessage import TextMessage

forecast = Weather()texter = TextMessage()

tomorrows_weather = forecast.tomorrow( "Portsmouth, UK“)

texter.send( '+44 7795 054500', tomorrows_weather)

Send

ing

via

SMS

CodeFurther...

Example Code – Weather Forecast

from codefurther.weather import Weatherfrom codefurther.twitter import Twitter

forecast = Weather()twitter = Twitter()

tomorrows_weather = forecast.tomorrow( "Portsmouth, UK“)

twitter.tweet( tomorrows_weather )

Send

ing

via

Twitt

er

CodeFurther...

from codefurther.weather import Weatherfrom codefurther.email import Email

forecast = Weather()emailer = Email()

tomorrows_weather = forecast.tomorrow( "Portsmouth, UK“)

emailer.send( '[email protected]', '[email protected]', "Here is tomorrow's weather forecast!", tomorrows_weather)

Example Code – Weather Forecast

Send

ing

via

Email

CodeFurther...

Example Code – Weather Forecast

from codefurther.weather import Weatherfrom codefurther.slack import Slack

forecast = Weather()slack = Slack()

tomorrows_weather = forecast.tomorrow( "Portsmouth, UK")

slack.post_message( tomorrows_weather, '#cas-hub') Se

ndin

g via

Slac

k

CodeFurther...

My questions to you…

• Does this look interesting?Concept

• What is the likely age range?• Is this suitable in lesson or for an after school club?Age / Capability

• Social communication in the school context?• Installation and data ‘issues’

Cons/Problems/Concerns

• IMDB, NASA Mission Data, iTunes trending, Google Maps, Search twitter, etc.Other data

• xSMS, Tweets, Email, Google+, Facebook, Guttenberg library, Snapchat, Flickr, Instagram, Complete web sites, etc.

Other Social Communication

CodeFurther...

Installation

pip install codefurther

•Python 2 and 3 code base

•Contributors welcome

•Looking for test users at the moment

CodeFurther...

Questions for me…

?

[email protected]

@dannygoodall

© Danny Goodall - 2015

Danny Goodall

CodeFurther...