alatham85
Posts: 4
Joined: Mon Jan 02, 2017 11:57 pm

LCD Rolling Display

Sat Jan 14, 2017 2:15 pm

Hi Guys

I know this may be a long shot but I was hoping to create a little project that allows me to display my favourite football teams upcoming fixtures and live in play scores on a little LCD screen but not sure how to get started or what I would need and which language to write the programme in any advice would be most welcome thank you in advance.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: LCD Rolling Display

Sun Jan 15, 2017 2:17 pm

How big a display? There is this, https://shop.pimoroni.com/products/unicorn-hat or something like this maybe, https://www.adafruit.com/products/420 Those are LED though. May be easier to see than LCD though. I have a scrolling display on my sense hats 8x8 LED matrix. It's very easy to see and read.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LCD Rolling Display

Mon Jan 16, 2017 9:19 pm

Well, if you do it in python, i have some code that can get football scores for you.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

alatham85
Posts: 4
Joined: Mon Jan 02, 2017 11:57 pm

Re: LCD Rolling Display

Tue Jan 17, 2017 6:07 pm

I would most likely go with the LED screen and if you could point me in the right direction of the python code that would be great thank you in advance.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: LCD Rolling Display

Tue Jan 17, 2017 7:48 pm

Adafruit have tutorials for most of the products they sell. Stuff like this, https://learn.adafruit.com/raspberry-pi ... ix-display They sell a lot of Arduino stuff too so sometimes that's all that's mentioned in the tutorial and you have to port it over to run on a Pi. Pimoroni does the same thing for its products and supplies python libraries and test code etc. Poke around in each sites learn section and you may get some ideas and a direction to follow.

https://learn.adafruit.com/category/raspberry-pi
https://learn.pimoroni.com/

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LCD Rolling Display

Fri Jan 20, 2017 1:46 pm

So, a while a go I wrote a python module that scraped the BBC website for football scores. There's a version of the module here.

You'll need to make sure you've also installed the BeautifulSoup module.

At it's most basic, you can do something like this for football match:

Code: Select all

>>> from footballscores import FootballMatch
>>> a=FootballMatch("Osasuna", detailed=True)
>>> print a
Osasuna 1-5 Athletic Bilbao (FT)
>>> print a.PrintDetail
(FT) Osasuna 1-5 Athletic Bilbao (Osasuna: E.Armenteros (10') - Athletic Bilbao: M.Susaeta (3'), A.Aduriz (16', 62'), I.G贸mez (84'), E.Sola Clemente (88'))
>>> a.HomeScorers
[(u'E.Armenteros', [u"10'"])]
>>> a.AwayScorers
[(u'M.Susaeta', [u"3'"]), (u'A.Aduriz', [u"16'", u"62'"]), (u'I.G\u8d38mez', [u"84'"]), (u'E.Sola Clemente', [u"88'"])]
>>> a.HomeYellowCards
[(u'J.Loties', [u"21'"]), (u'F.Silva', [u"47'"]), (u'Acu\u5e3da', [u"65'"]), (u'A.Arribas', [u"71'"])]
>>> a.AwayYellowCards
[(u'A.Iturraspe', [u"19'"]), (u'A.Aduriz', [u"27'"]), (u'C.Gurpegi', [u"51'"]), (u'M.Balenziaga', [u"72'"])]
>>> a.HomeRedCards
[(u'A.Arribas', [u"76'"])]
>>> a.AwayRedCards
[]
>>> a.MatchTime
'FT'
Fixtures are a bit more experimental. At the moment, you can just do fixtures by league/competition rather than club. There's a Fixtures class which you can use. I can give you some example code over the weekend as I don't have any to hand.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LCD Rolling Display

Fri Jan 20, 2017 7:08 pm

Ok. So Fixtures currently work like this

Code: Select all

In [1]: import footballscores

In [2]: fix = footballscores.Fixtures()

In [3]: fix.getCompetitions()    ## <-- This lists the available competitions and their ID
Out[3]: 
[{'id': u'competition-118996114', 'name': u'Premier League'},
 {'id': u'competition-118996115', 'name': u'Championship'},
 {'id': u'competition-118996116', 'name': u'League One'},
 {'id': u'competition-118996117', 'name': u'League Two'},
 {'id': u'competition-118996118', 'name': u'National League'},
 {'id': u'competition-118996307', 'name': u'National League North'},
 {'id': u'competition-118996308', 'name': u'National League South'},
 {'id': u'competition-118998036', 'name': u'FA Cup'},
 {'id': u'competition-118998039', 'name': u'FA Cup Qualifying'},
 {'id': u'competition-118998037', 'name': u'EFL Cup'},
 {'id': u'competition-118998038', 'name': u'EFL Trophy'},
 {'id': u'competition-118998041', 'name': u'The FA Trophy'},
 {'id': u'group-1', 'name': u'All English'},
 {'id': u'competition-118996176', 'name': u'Scottish Premiership'},
 {'id': u'competition-118996177', 'name': u'Scottish Championship'},
 {'id': u'competition-118996178', 'name': u'Scottish League One'},
 {'id': u'competition-118996179', 'name': u'Scottish League Two'},
 {'id': u'competition-118999031', 'name': u'Highland League'},
 {'id': u'competition-119003997', 'name': u'Lowland League'},
 {'id': u'competition-118998098', 'name': u'Scottish Cup'},
 {'id': u'competition-118998099', 'name': u'Scottish League Cup'},
 {'id': u'competition-118998100', 'name': u'Scottish Challenge Cup'},
 {'id': u'group-2', 'name': u'All Scottish'},
 {'id': u'competition-118996207', 'name': u'Welsh Premier League'},
 {'id': u'competition-118998129', 'name': u'Welsh Cup'},
 {'id': u'competition-118996208', 'name': u'Welsh League Cup'},
 {'id': u'group-3', 'name': u'All Welsh'},
 {'id': u'competition-118996238', 'name': u'Irish Premiership'},
 {'id': u'competition-118998043', 'name': u'Irish Cup'},
 {'id': u'competition-118996240', 'name': u'Irish Premier Division'},
 {'id': u'group-4', 'name': u'All Irish'},
 {'id': u'competition-119001914', 'name': u'Africa Cup of Nations'},
 {'id': u'competition-119001881', 'name': u'World Cup Qualifying - European'},
 {'id': u'competition-119001943', 'name': u'International Friendlies'},
 {'id': u'competition-119002004', 'name': u'Euro U21 Qualifying'},
 {'id': u'competition-119001974', 'name': u'Under-21 Friendly'},
 {'id': u'competition-999999985',
  'name': u"Women's European Championship Qualifying"},
 {'id': u'competition-999999987', 'name': u"Women's International Friendlies"},
 {'id': u'competition-119002035', 'name': u'European Championship'},
 {'id': u'group-6', 'name': u'All International'},
 {'id': u'competition-119003064', 'name': u'Club World Cup'},
 {'id': u'competition-118999958', 'name': u'Champions League'},
 {'id': u'competition-118999989', 'name': u'Europa League'},
 {'id': u'competition-999999995', 'name': u'Australian A-League'},
 {'id': u'competition-119000919', 'name': u'Austrian Bundesliga'},
 {'id': u'competition-119000924', 'name': u'Belgian First Division A'},
 {'id': u'competition-999999996', 'name': u'Brazilian S\xe9rie A'},
 {'id': u'competition-119000950', 'name': u'Danish Superliga'},
 {'id': u'competition-119001012', 'name': u'Dutch Eredivisie'},
 {'id': u'competition-119000955', 'name': u'Finnish Veikkausliiga'},
 {'id': u'competition-119000981', 'name': u'French Ligue 1'},
 {'id': u'competition-999999997', 'name': u'French Coupe de France'},
 {'id': u'competition-119000986', 'name': u'German Bundesliga'},
 {'id': u'competition-999999998', 'name': u'German DFB Cup'},
 {'id': u'competition-119001136', 'name': u'Greek Superleague'},
 {'id': u'competition-119001017', 'name': u'Italian Serie A'},
 {'id': u'competition-999999999', 'name': u'Italian Coppa Italia'},
 {'id': u'competition-119001043', 'name': u'Norwegian Tippeligaen'},
 {'id': u'competition-119001048', 'name': u'Portuguese Primeira Liga'},
 {'id': u'competition-999999990', 'name': u'Russian Premier League'},
 {'id': u'competition-119001074', 'name': u'Spanish La Liga'},
 {'id': u'competition-999999989', 'name': u'Spanish Copa del Rey'},
 {'id': u'competition-119001079', 'name': u'Swedish Allsvenskan'},
 {'id': u'competition-119001105', 'name': u'Swiss Super League'},
 {'id': u'competition-119001110', 'name': u'Turkish Super Lig'},
 {'id': u'competition-999999988',
  'name': u'United States Major League Soccer'},
 {'id': u'group-5', 'name': u'All European & World'},
 {'id': u'competition-119004019', 'name': u"Women's Champions League"},
 {'id': u'competition-119003989', 'name': u"Women's Super League 1"},
 {'id': u'competition-999999993', 'name': u"Women's Super League 2"},
 {'id': u'competition-118998132', 'name': u"The FA Women's Cup"},
 {'id': u'competition-118998135', 'name': u"Women's League Cup"},
 {'id': u'competition-999999991', 'name': u"Women's Premier North"},
 {'id': u'competition-999999992', 'name': u"Women's Premier South"},
 {'id': u'group-7', 'name': u'All Women'}]

In [5]: fix.getFixtures("competition-118996114")   ## <-- This will get the fixtures for the Premier League
Out[5]: 
[{'date': u'Saturday 21st January 2017',
  'fixtures': [{'awayteam': u'Swansea City', 'hometeam': u'Liverpool'},
   {'awayteam': u'Watford', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Everton', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'West Ham United', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Manchester United', 'hometeam': u'Stoke City'},
   {'awayteam': u'Sunderland', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Manchester City'}]},
 {'date': u'Sunday 22nd January 2017',
  'fixtures': [{'awayteam': u'Leicester City', 'hometeam': u'Southampton'},
   {'awayteam': u'Burnley', 'hometeam': u'Arsenal'},
   {'awayteam': u'Hull City', 'hometeam': u'Chelsea'}]},
 {'date': u'Tuesday 31st January 2017',
  'fixtures': [{'awayteam': u'Watford', 'hometeam': u'Arsenal'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Leicester City', 'hometeam': u'Burnley'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Sunderland'},
   {'awayteam': u'Southampton', 'hometeam': u'Swansea City'},
   {'awayteam': u'Chelsea', 'hometeam': u'Liverpool'}]},
 {'date': u'Wednesday 1st February 2017',
  'fixtures': [{'awayteam': u'Manchester City',
    'hometeam': u'West Ham United'},
   {'awayteam': u'Hull City', 'hometeam': u'Manchester United'},
   {'awayteam': u'Everton', 'hometeam': u'Stoke City'}]},
 {'date': u'Saturday 4th February 2017',
  'fixtures': [{'awayteam': u'Arsenal', 'hometeam': u'Chelsea'},
   {'awayteam': u'Sunderland', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Everton'},
   {'awayteam': u'Liverpool', 'hometeam': u'Hull City'},
   {'awayteam': u'West Ham United', 'hometeam': u'Southampton'},
   {'awayteam': u'Burnley', 'hometeam': u'Watford'},
   {'awayteam': u'Stoke City', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Tottenham Hotspur'}]},
 {'date': u'Sunday 5th February 2017',
  'fixtures': [{'awayteam': u'Swansea City', 'hometeam': u'Manchester City'},
   {'awayteam': u'Manchester United', 'hometeam': u'Leicester City'}]},
 {'date': u'Saturday 11th February 2017',
  'fixtures': [{'awayteam': u'Hull City', 'hometeam': u'Arsenal'},
   {'awayteam': u'Watford', 'hometeam': u'Manchester United'},
   {'awayteam': u'Everton', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Stoke City'},
   {'awayteam': u'Southampton', 'hometeam': u'Sunderland'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'West Ham United'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Liverpool'}]},
 {'date': u'Sunday 12th February 2017',
  'fixtures': [{'awayteam': u'Chelsea', 'hometeam': u'Burnley'},
   {'awayteam': u'Leicester City', 'hometeam': u'Swansea City'}]},
 {'date': u'Monday 13th February 2017',
  'fixtures': [{'awayteam': u'Manchester City', 'hometeam': u'Bournemouth'}]},
 {'date': u'Saturday 25th February 2017',
  'fixtures': [{'awayteam': u'Swansea City', 'hometeam': u'Chelsea'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Sunderland', 'hometeam': u'Everton'},
   {'awayteam': u'Burnley', 'hometeam': u'Hull City'},
   {'awayteam': u'Arsenal', 'hometeam': u'Southampton'},
   {'awayteam': u'Bournemouth', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'West Ham United', 'hometeam': u'Watford'}]},
 {'date': u'Sunday 26th February 2017',
  'fixtures': [{'awayteam': u'Stoke City', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Manchester United', 'hometeam': u'Manchester City'}]},
 {'date': u'Monday 27th February 2017',
  'fixtures': [{'awayteam': u'Liverpool', 'hometeam': u'Leicester City'}]},
 {'date': u'Saturday 4th March 2017',
  'fixtures': [{'awayteam': u'Hull City', 'hometeam': u'Leicester City'},
   {'awayteam': u'Arsenal', 'hometeam': u'Liverpool'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Manchester United'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Stoke City'},
   {'awayteam': u'Manchester City', 'hometeam': u'Sunderland'},
   {'awayteam': u'Burnley', 'hometeam': u'Swansea City'},
   {'awayteam': u'Everton', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Southampton', 'hometeam': u'Watford'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Chelsea', 'hometeam': u'West Ham United'}]},
 {'date': u'Saturday 11th March 2017',
  'fixtures': [{'awayteam': u'Leicester City', 'hometeam': u'Arsenal'},
   {'awayteam': u'West Ham United', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Watford', 'hometeam': u'Chelsea'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Everton'},
   {'awayteam': u'Swansea City', 'hometeam': u'Hull City'},
   {'awayteam': u'Stoke City', 'hometeam': u'Manchester City'},
   {'awayteam': u'Sunderland', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Manchester United', 'hometeam': u'Southampton'}]},
 {'date': u'Sunday 12th March 2017',
  'fixtures': [{'awayteam': u'Burnley', 'hometeam': u'Liverpool'}]},
 {'date': u'Saturday 18th March 2017',
  'fixtures': [{'awayteam': u'Swansea City', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Watford', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Hull City', 'hometeam': u'Everton'},
   {'awayteam': u'Liverpool', 'hometeam': u'Manchester City'},
   {'awayteam': u'Manchester United', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Chelsea', 'hometeam': u'Stoke City'},
   {'awayteam': u'Burnley', 'hometeam': u'Sunderland'},
   {'awayteam': u'Southampton', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Arsenal', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Leicester City', 'hometeam': u'West Ham United'}]},
 {'date': u'Saturday 1st April 2017',
  'fixtures': [{'awayteam': u'Manchester City', 'hometeam': u'Arsenal'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Burnley'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Chelsea'},
   {'awayteam': u'West Ham United', 'hometeam': u'Hull City'},
   {'awayteam': u'Stoke City', 'hometeam': u'Leicester City'},
   {'awayteam': u'Everton', 'hometeam': u'Liverpool'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Manchester United'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Southampton'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Swansea City'},
   {'awayteam': u'Sunderland', 'hometeam': u'Watford'}]},
 {'date': u'Tuesday 4th April 2017',
  'fixtures': [{'awayteam': u'West Ham United', 'hometeam': u'Arsenal'},
   {'awayteam': u'Stoke City', 'hometeam': u'Burnley'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Hull City'},
   {'awayteam': u'Sunderland', 'hometeam': u'Leicester City'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Swansea City'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Watford'},
   {'awayteam': u'Everton', 'hometeam': u'Manchester United'}]},
 {'date': u'Wednesday 5th April 2017',
  'fixtures': [{'awayteam': u'Manchester City', 'hometeam': u'Chelsea'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Southampton'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Liverpool'}]},
 {'date': u'Saturday 8th April 2017',
  'fixtures': [{'awayteam': u'Chelsea', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Arsenal', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Leicester City', 'hometeam': u'Everton'},
   {'awayteam': u'Hull City', 'hometeam': u'Manchester City'},
   {'awayteam': u'Burnley', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Liverpool', 'hometeam': u'Stoke City'},
   {'awayteam': u'Manchester United', 'hometeam': u'Sunderland'},
   {'awayteam': u'Watford', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Southampton', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Swansea City', 'hometeam': u'West Ham United'}]},
 {'date': u'Saturday 15th April 2017',
  'fixtures': [{'awayteam': u'Leicester City', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Burnley', 'hometeam': u'Everton'},
   {'awayteam': u'Chelsea', 'hometeam': u'Manchester United'},
   {'awayteam': u'Arsenal', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Manchester City', 'hometeam': u'Southampton'},
   {'awayteam': u'Hull City', 'hometeam': u'Stoke City'},
   {'awayteam': u'West Ham United', 'hometeam': u'Sunderland'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Swansea City', 'hometeam': u'Watford'}]},
 {'date': u'Sunday 16th April 2017',
  'fixtures': [{'awayteam': u'Liverpool',
    'hometeam': u'West Bromwich Albion'}]},
 {'date': u'Saturday 22nd April 2017',
  'fixtures': [{'awayteam': u'Sunderland', 'hometeam': u'Arsenal'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Manchester United', 'hometeam': u'Burnley'},
   {'awayteam': u'Southampton', 'hometeam': u'Chelsea'},
   {'awayteam': u'Watford', 'hometeam': u'Hull City'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Leicester City'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Liverpool'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Manchester City'},
   {'awayteam': u'Stoke City', 'hometeam': u'Swansea City'},
   {'awayteam': u'Everton', 'hometeam': u'West Ham United'}]},
 {'date': u'Saturday 29th April 2017',
  'fixtures': [{'awayteam': u'Burnley', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Chelsea', 'hometeam': u'Everton'},
   {'awayteam': u'Swansea City', 'hometeam': u'Manchester United'},
   {'awayteam': u'Manchester City', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Hull City', 'hometeam': u'Southampton'},
   {'awayteam': u'West Ham United', 'hometeam': u'Stoke City'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Sunderland'},
   {'awayteam': u'Arsenal', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Liverpool', 'hometeam': u'Watford'},
   {'awayteam': u'Leicester City', 'hometeam': u'West Bromwich Albion'}]},
 {'date': u'Saturday 6th May 2017',
  'fixtures': [{'awayteam': u'Manchester United', 'hometeam': u'Arsenal'},
   {'awayteam': u'Stoke City', 'hometeam': u'Bournemouth'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Burnley'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Chelsea'},
   {'awayteam': u'Sunderland', 'hometeam': u'Hull City'},
   {'awayteam': u'Watford', 'hometeam': u'Leicester City'},
   {'awayteam': u'Southampton', 'hometeam': u'Liverpool'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Manchester City'},
   {'awayteam': u'Everton', 'hometeam': u'Swansea City'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'West Ham United'}]},
 {'date': u'Saturday 13th May 2017',
  'fixtures': [{'awayteam': u'Burnley', 'hometeam': u'Bournemouth'},
   {'awayteam': u'Hull City', 'hometeam': u'Crystal Palace'},
   {'awayteam': u'Watford', 'hometeam': u'Everton'},
   {'awayteam': u'Leicester City', 'hometeam': u'Manchester City'},
   {'awayteam': u'Southampton', 'hometeam': u'Middlesbrough'},
   {'awayteam': u'Arsenal', 'hometeam': u'Stoke City'},
   {'awayteam': u'Swansea City', 'hometeam': u'Sunderland'},
   {'awayteam': u'Manchester United', 'hometeam': u'Tottenham Hotspur'},
   {'awayteam': u'Chelsea', 'hometeam': u'West Bromwich Albion'},
   {'awayteam': u'Liverpool', 'hometeam': u'West Ham United'}]},
 {'date': u'Sunday 21st May 2017',
  'fixtures': [{'awayteam': u'Everton', 'hometeam': u'Arsenal'},
   {'awayteam': u'West Ham United', 'hometeam': u'Burnley'},
   {'awayteam': u'Sunderland', 'hometeam': u'Chelsea'},
   {'awayteam': u'Tottenham Hotspur', 'hometeam': u'Hull City'},
   {'awayteam': u'Bournemouth', 'hometeam': u'Leicester City'},
   {'awayteam': u'Middlesbrough', 'hometeam': u'Liverpool'},
   {'awayteam': u'Crystal Palace', 'hometeam': u'Manchester United'},
   {'awayteam': u'Stoke City', 'hometeam': u'Southampton'},
   {'awayteam': u'West Bromwich Albion', 'hometeam': u'Swansea City'},
   {'awayteam': u'Manchester City', 'hometeam': u'Watford'}]}]
Hope that helps.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

PeppaPigKilla
Posts: 4
Joined: Sat Jan 28, 2017 6:53 pm

Re: LCD Rolling Display

Sat Jan 28, 2017 6:55 pm

elParaguayo wrote:So, a while a go I wrote a python module that scraped the BBC website for football scores. There's a version of the module here.

You'll need to make sure you've also installed the BeautifulSoup module.

At it's most basic, you can do something like this for football match:

Code: Select all

>>> from footballscores import FootballMatch
>>> a=FootballMatch("Osasuna", detailed=True)
>>> print a
Osasuna 1-5 Athletic Bilbao (FT)
>>> print a.PrintDetail
(FT) Osasuna 1-5 Athletic Bilbao (Osasuna: E.Armenteros (10') - Athletic Bilbao: M.Susaeta (3'), A.Aduriz (16', 62'), I.G贸mez (84'), E.Sola Clemente (88'))
>>> a.HomeScorers
[(u'E.Armenteros', [u"10'"])]
>>> a.AwayScorers
[(u'M.Susaeta', [u"3'"]), (u'A.Aduriz', [u"16'", u"62'"]), (u'I.G\u8d38mez', [u"84'"]), (u'E.Sola Clemente', [u"88'"])]
>>> a.HomeYellowCards
[(u'J.Loties', [u"21'"]), (u'F.Silva', [u"47'"]), (u'Acu\u5e3da', [u"65'"]), (u'A.Arribas', [u"71'"])]
>>> a.AwayYellowCards
[(u'A.Iturraspe', [u"19'"]), (u'A.Aduriz', [u"27'"]), (u'C.Gurpegi', [u"51'"]), (u'M.Balenziaga', [u"72'"])]
>>> a.HomeRedCards
[(u'A.Arribas', [u"76'"])]
>>> a.AwayRedCards
[]
>>> a.MatchTime
'FT'
Fixtures are a bit more experimental. At the moment, you can just do fixtures by league/competition rather than club. There's a Fixtures class which you can use. I can give you some example code over the weekend as I don't have any to hand.
Love the idea of this but have no idea how to install/make it work, checked your git and no instructions for the newb that i am.

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LCD Rolling Display

Sun Jan 29, 2017 8:43 pm

Easiest way to use it: Copy that code into a new file called footballscores.py and put it in the same folder as your python script.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

PeppaPigKilla
Posts: 4
Joined: Sat Jan 28, 2017 6:53 pm

Re: LCD Rolling Display

Sun Jan 29, 2017 9:11 pm

elParaguayo wrote:Easiest way to use it: Copy that code into a new file called footballscores.py and put it in the same folder as your python script.
Thing is i have no python script at all, what script would run this just for this ?

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: LCD Rolling Display

Sun Jan 29, 2017 10:43 pm

Then forget the football scores for the moment. Find a display that you want to use and then work out how to display basic text on it with python. Only then should you start thinking about what text you want to show.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: LCD Rolling Display

Mon Jan 30, 2017 10:51 am

Dito to what was posted above. That's how I started with my sense hats LED matrix. I got it to display a simple message, then played with adding more info, and messing with the colors. Take it in steps. Get it to show a message, then change what the message is. ;)

alphanumeric
Posts: 2566
Joined: Tue Jan 19, 2016 2:17 pm
Location: Sydney, Nova Scotia, Canada

Re: LCD Rolling Display

Mon Jan 30, 2017 10:55 am


Return to “Graphics, sound and multimedia”