professional layout

This commit is contained in:
Neythen 2021-07-16 12:01:41 +01:00
parent c048b20807
commit 4aafe2fc5f
9 changed files with 35 additions and 32 deletions

View File

@ -1,4 +1,4 @@
symbol,name,base,current,24hr change
BTC,bitcoin,usd,31363,-1.3997435288701887
ETH,ethereum,gbp,1352.07,-2.266523397486414
DOGE,dogecoin,usd,0.181538,-4.553254701438885
BTC,bitcoin,usd,31377,-1.7468733440038657
ETH,ethereum,gbp,1355.57,-2.5698610989558937
DOGE,dogecoin,usd,0.181844,-4.182728647925469

1 symbol name base current 24hr change
2 BTC bitcoin usd 31363 31377 -1.3997435288701887 -1.7468733440038657
3 ETH ethereum gbp 1352.07 1355.57 -2.266523397486414 -2.5698610989558937
4 DOGE dogecoin usd 0.181538 0.181844 -4.553254701438885 -4.182728647925469

View File

@ -1 +1 @@
[{"main_weather": "Rain", "description": "light rain", "temp": 29.25, "min_temp": 28.44, "max_temp": 30.37, "feels_like": 36.16, "humidity": 83, "clouds": 67, "wind_speed": 0.45, "wind_direction": 43, "visibility": 10000, "uv": 0, "rain_chance": 0.2}, {"main_weather": "Clear", "description": "clear sky", "temp": 22.41, "min_temp": 12.13, "max_temp": 25.11, "feels_like": 22.09, "humidity": 53, "clouds": 0, "wind_speed": 3.09, "wind_direction": 340, "visibility": 10000, "uv": 7.13, "rain_chance": 0}]
[{"main_weather": "Rain", "description": "light rain", "temp": 29.25, "min_temp": 28.44, "max_temp": 30.37, "feels_like": 35.92, "humidity": 82, "clouds": 67, "wind_speed": 1.34, "wind_direction": 41, "visibility": 10000, "uv": 0, "rain_chance": 0.2}, {"main_weather": "Clear", "description": "clear sky", "temp": 22.69, "min_temp": 12.13, "max_temp": 25.11, "feels_like": 22.37, "humidity": 52, "clouds": 0, "wind_speed": 3.09, "wind_direction": 340, "visibility": 10000, "uv": 7.13, "rain_chance": 0}]

View File

@ -1 +1 @@
[[{"main_weather": "Rain", "description": "light rain", "min_temp": 28.44, "max_temp": 30.37}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.83, "max_temp": 29.38}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.46, "max_temp": 28.27}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.86, "max_temp": 27.9}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.2, "max_temp": 28.18}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.33, "max_temp": 29.33}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.22, "max_temp": 31.57}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.13, "max_temp": 31.38}], [{"main_weather": "Clear", "description": "clear sky", "min_temp": 12.13, "max_temp": 25.11}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 15.69, "max_temp": 27.68}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 18.42, "max_temp": 28.52}, {"main_weather": "Rain", "description": "light rain", "min_temp": 17.16, "max_temp": 23.64}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 15.21, "max_temp": 24.05}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 14.51, "max_temp": 23.63}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 14.55, "max_temp": 22.1}, {"main_weather": "Rain", "description": "light rain", "min_temp": 16.33, "max_temp": 25.36}]]
[[{"main_weather": "Rain", "description": "moderate rain", "min_temp": 28.44, "max_temp": 30.37}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.83, "max_temp": 29.38}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.46, "max_temp": 28.27}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 26.86, "max_temp": 27.9}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 27.2, "max_temp": 28.18}, {"main_weather": "Rain", "description": "light rain", "min_temp": 27.33, "max_temp": 29.33}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.22, "max_temp": 31.57}, {"main_weather": "Rain", "description": "light rain", "min_temp": 28.13, "max_temp": 31.38}], [{"main_weather": "Clear", "description": "clear sky", "min_temp": 12.13, "max_temp": 25.11}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 15.69, "max_temp": 27.68}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 18.42, "max_temp": 28.52}, {"main_weather": "Rain", "description": "light rain", "min_temp": 17.16, "max_temp": 23.64}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 15.21, "max_temp": 24.05}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 14.51, "max_temp": 23.63}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 14.55, "max_temp": 22.1}, {"main_weather": "Rain", "description": "light rain", "min_temp": 16.33, "max_temp": 25.36}]]

View File

@ -1 +1 @@
{"stocks": "16/07/2021 06:50:18", "crypto": "16/07/2021 06:50:20", "news": "16/07/2021 06:50:22", "weather": "16/07/2021 06:50:21", "forex": "16/07/2021 12:50:24", "sports": "16/07/2021 06:50:22"}
{"stocks": "16/07/2021 07:01:02", "crypto": "16/07/2021 07:01:04", "news": "16/07/2021 07:01:06", "weather": "16/07/2021 07:01:05", "forex": "16/07/2021 13:01:09", "sports": "16/07/2021 07:01:07"}

View File

@ -1,21 +1,21 @@
headline,source,date,time
Germany-Belgium floods live: 90 dead and 1^300 missing in catastrophe^ with more rain forecast in Europe - The Independent,Independent,2021-07-16,08:35:46Z
IATF approves PH hosting of Asian women's volleyball tilt in August - CNN Philippines,CNN Philippines,2021-07-16,08:35:19Z
COVID-19 kills 162 more in PH^ says DOH - INQUIRER.net,Inquirer.net,2021-07-16,08:34:00Z
Cele headed back to Phoenix as violence continues in parts of KZN - Eyewitness News,EWN,2021-07-16,08:29:45Z
Years away from PBA^ Gab Banal gives Alaska steady presence - Rappler,Rappler,2021-07-16,08:21:00Z
EU new car sales rise^ as Bank of Japan cuts economic growth forecast business live - The Guardian,The Guardian,2021-07-16,08:19:26Z
Ten stories from China: Mars^ beautiful music and an emotional reunion - CGTN,Cgtn.com,2021-07-16,08:11:21Z
As Delta drives COVID surge^ vaccines^ strategies under scrutiny - Al Jazeera English,Al Jazeera English,2021-07-16,08:10:15Z
UK hot weather: 'Bermuda blowtorch' 90F scorcher to singe Britain for Freedom Day - maps - Daily Express,Express,2021-07-16,08:09:30Z
Children's viruses that disappeared during pandemic lockdowns are back^ doctors say - CBC.ca,CBC News,2021-07-16,08:00:00Z
Evacuations as flooding hits Buller district^ locals urged to get grab bags ready - Stuff.co.nz,Stuff.co.nz,2021-07-16,07:54:00Z
PDP-Laban House members back Cusi leadership - Rappler,Rappler,2021-07-16,07:53:00Z
Majority of clinical cases of COVID-19 breakthrough infection due to Delta variant: ICMR study - The New Indian Express,The New Indian Express,2021-07-16,07:46:00Z
Aussie scientists see life-saving potential in spider venom to halt effects of heart attacks - GMA News Online,GMA News,2021-07-16,07:44:26Z
Lions coach Gatland pokes fun at Rassie's 'water boy' role - News24,News24,2021-07-16,07:42:05Z
93 people dead and hundreds missing in huge floods in Germany and Belgium - TheJournal.ie,TheJournal.ie,2021-07-16,07:41:00Z
Driving instructor allegedly falsified motorbike licences for gang members - Stuff.co.nz,Stuff.co.nz,2021-07-16,07:40:00Z
Unconventional superconductor acts the part of a promising quantum computing platform - Phys.org,Phys.Org,2021-07-16,07:30:13Z
Kyla opens up about suffering third miscarriage - Rappler,Rappler,2021-07-16,07:29:00Z
Indian photojournalist Danish Siddiqui killed in Afghanistans Kandahar province - Hindustan Times,Hindustan Times,2021-07-16,07:23:12Z
Wobbling moon^ climate change to raise flood risk in 2030s: NASA - Sify,Sify News,2021-07-16,10:30:36Z
Coronavirus: Is my chest pain an outcome of COVID-19 or anxiety? - Times of India,The Times of India,2021-07-16,10:30:00Z
NRL 2021 LIVE updates: Sea Eagles v Dragons^ Eels beat Titans 26-8 - The Sydney Morning Herald,The Sydney Morning Herald,2021-07-16,10:29:58Z
LCO astronomers say comet C/2014 UN271 is the largest ever discovered - SlashGear,SlashGear,2021-07-16,10:29:00Z
Jacob Zuma: South Africa unrest was planned President Ramaphosa - Daily Post Nigeria,Daily Post Nigeria,2021-07-16,10:26:37Z
UK Covid live: hospitalisation numbers could reach quite scary levels in weeks^ says Chris Whitty - The Guardian,The Guardian,2021-07-16,10:26:19Z
18-year-old customer on Jeff Bezos' Blue Origin rocket to be youngest person ever in space - NBC News,NBC News,2021-07-16,10:14:00Z
"Shocked" Court Denies Bail To Jamia Shooter In Hate Speech Case - NDTV,NDTV News,2021-07-16,10:11:12Z
PDP-Laban: From fighting dictatorship to fighting each other - INQUIRER.net,Inquirer.net,2021-07-16,10:11:00Z
Germany floods: Rhineland-Palatinate German state be worst hit for west Germany and Belgium floods - BBC News,BBC News,2021-07-16,10:09:25Z
Producing memory from speckle patterns - Phys.org,Phys.Org,2021-07-16,09:59:13Z
Rain or Shine survives NLEX as Kiefer Ravena recommits to lineup - Rappler,Rappler,2021-07-16,09:57:00Z
ICC Men's T20 World Cup groups announced - International Cricket Council,International Cricket Council,2021-07-16,09:51:49Z
Surge-ing ahead: CITF aims to have all adult residents in KL^ Selangor vaccinated by Aug 1 - The Star Online,The Star Online,2021-07-16,09:51:00Z
KTV Covid-19 cluster: Only 6 of first 88 cases fully vaccinated; include 'frequent patrons' aged 19 to 60 - TODAYonline,TODAYonline,2021-07-16,09:50:13Z
Over 200000 people quarantined as part of wide net cast to contain KTV Covid-19 cluster: Ong Ye Kung - TODAYonline,TODAYonline,2021-07-16,09:50:12Z
Santos becomes fourth company to abandon drilling intentions in the Great Australian Bight - ABC News,ABC News (AU),2021-07-16,09:49:09Z
Group sizes for indoor high-intensity mask-off activities reduced amid tighter COVID-19 measures - CNA,CNA,2021-07-16,09:47:50Z
Pulitzer Prize-winning Reuters photographer Danish Siddiqui killed in Afghanistan - CNN ,CNN,2021-07-16,09:47:00Z
These 5 symptoms in 1st week of infection may up risk of long Covid - IOL,IOL,2021-07-16,09:34:56Z

Can't render this file because it contains an unexpected character in line 9 and column 9.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -986,7 +986,7 @@ class StockTicker():
source_font = ImageFont.load("./fonts/6x10.pil")
title_img = self.openImage('feature_titles/small_feature_titles/news.png')
image_list = [title_img]
image_list = [title_img, self.blank]
headlines = []
sources = []
@ -997,7 +997,7 @@ class StockTicker():
for row in CSV:
headline, source, date, time = row
headlines.append(headline)
sources.append(source + ': ')
sources.append(source)
f.close()
@ -1018,7 +1018,7 @@ class StockTicker():
headline = lst[0]
headline_img = self.textImage(headline, headline_font, matrix_height = True)
source_img = self.textImage(sources[i], source_font, r=255, g=255, b=0, matrix_height = True)
source_img = self.textImage(sources[i] + ':', source_font, r=255, g=255, b=0, matrix_height = True)
try:
@ -1031,17 +1031,20 @@ class StockTicker():
logo = logo.resize((int(width/2), int(height/2)))
img = Image.new('RGB', (headline_img.size[0]+ source_img.size[0] + logo.size[0] +5, 32))
img.paste(headline_img, (source_img.size[0]+ + logo.size[0] +5, 3))
img.paste(headline_img, (source_img.size[0]+ logo.size[0] -5, 3))
img.paste(source_img, (2,3))
img= self.stitchImage([logo,img])
except Exception as e:
image_list.append(self.blank)
img = Image.new('RGB', (headline_img.size[0] + source_img.size[0] +5, 32))
img.paste(headline_img, (source_img.size[0]+ 5, 3))
img.paste(source_img, (2,3))
image_list.append(img)
image_list.append(blank)
news_image = self.stitchImage(image_list)
@ -1991,7 +1994,7 @@ if __name__ == '__main__':
#
#stock_ticker.process_msg('G')
#stock_ticker.process_msg('b')
#stock_ticker.process_msg('G')
#stock_ticker.process_msg('f')
#stock_ticker.process_msg('W')