Experimental communication tools (televex screen + televex print)
https://televex.vvvvvvaria.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.0 KiB
143 lines
4.0 KiB
4 years ago
|
import feedparser
|
||
|
import os
|
||
|
from icalendar import Calendar
|
||
|
import datetime
|
||
|
from requests import get
|
||
|
import urllib
|
||
|
import json
|
||
|
import pypandoc
|
||
|
import time
|
||
|
|
||
|
ics = get("https://varia.zone/events.ics").text
|
||
|
gcal = Calendar.from_ical(ics)
|
||
|
now = datetime.datetime.now()
|
||
|
|
||
|
while True:
|
||
|
|
||
4 years ago
|
#os.system("toilet --gay -w 125 -W --filter border:gay \ \ \ \ \ VARIA\ \ \ \ \ ")
|
||
|
os.system("./venv/bin/python3 tools/ascii-art-but-with-unicode/repeated_sinus_amplitude_variation.py | lolcat -a -d 1")
|
||
4 years ago
|
print("")
|
||
4 years ago
|
time.sleep(1)
|
||
4 years ago
|
|
||
|
abouts = ["""
|
||
4 years ago
|
|
||
|
[NL]
|
||
|
|
||
|
Varia is een collectieve ruimte in Rotterdam
|
||
|
die zich richt op alledaagse technologie.
|
||
|
|
||
|
Wij zijn van mening dat technologie niet het
|
||
|
exclusieve domein van specialisten moet zijn.
|
||
|
Technologie beinvloedt iedereen en zou verschil-
|
||
|
lende manieren van leven mogelijk moeten maken,
|
||
|
in plaats van deze uit te sluiten. We vatten
|
||
|
alledaagse technologie breed op; niet alleen
|
||
|
computers, standaarden of protocollen horen
|
||
|
daarbij, maar bijvoorbeeld ook kookgereedschap
|
||
|
of muziekinstrumenten.
|
||
|
|
||
|
Vanuit onze achtergrond in kunst, ontwerp,
|
||
|
software & hardware, onderwijs en theoretische
|
||
|
praktijken, voelen we de behoefte om een plek
|
||
|
te vormen waar technologie en sociale vragen
|
||
|
met elkaar verbonden zijn; een plek waar
|
||
|
samenwerking, continuteit, ontwikkeling,
|
||
|
collectief leren, nieuwsgierigheid en experi-
|
||
|
ment voorop staan.
|
||
|
|
||
4 years ago
|
""",
|
||
|
"""
|
||
4 years ago
|
[EN]
|
||
|
|
||
|
Varia is a collective-space in Rotterdam
|
||
|
focused on everyday technologies.
|
||
|
|
||
|
We believe technology should not be the
|
||
|
exclusive domain of specialists. It affects
|
||
|
everyone and should enable, rather than
|
||
|
preclude, diverse ways of living. We under-
|
||
|
stand everyday technology broadly; not just
|
||
|
as computers, standards, or protocols, but
|
||
|
also, for example, as cooking tools or
|
||
|
musical instruments.
|
||
|
|
||
|
Being involved in the fields of art, design,
|
||
|
software & hardware, education and theoretical
|
||
|
practices, we felt the need for a place where
|
||
|
technology and social questions are linked; a
|
||
|
place where collaboration, continuity, develop-
|
||
|
ment, collective learning, curiosity and ex-
|
||
|
periments are foregrounded.
|
||
|
|
||
|
"""
|
||
4 years ago
|
]
|
||
|
# for lang in abouts:
|
||
|
# for line in lang.split('\n'):
|
||
4 years ago
|
# os.system(f"echo '{ line }' | lolcat -a -d 1")
|
||
|
|
||
|
os.system("./venv/bin/python3 tools/ascii-art-but-with-unicode/multi_column_page.py | lolcat -a -d 1")
|
||
|
|
||
|
print("")
|
||
|
time.sleep(3)
|
||
4 years ago
|
|
||
|
for c in gcal.walk():
|
||
|
|
||
|
if c.name == "VEVENT":
|
||
|
|
||
|
date = c.get("dtstart").dt
|
||
|
title = c.get("summary")
|
||
|
|
||
|
if date > now:
|
||
|
|
||
4 years ago
|
# An attempt to keep TeleVex running throughout the night
|
||
|
# (even if the Multifeeder/server is not available)
|
||
|
try:
|
||
|
url = 'https://multi.vvvvvvaria.org/API/latest/25'
|
||
|
response = urllib.request.urlopen(url).read()
|
||
|
multifeeder = json.loads(response)
|
||
4 years ago
|
|
||
4 years ago
|
except:
|
||
4 years ago
|
|
||
4 years ago
|
multifeeder = []
|
||
|
os.system("toilet -f script -w 125 --gay Zzz... the server sleeps.")
|
||
4 years ago
|
|
||
|
for post in multifeeder:
|
||
|
|
||
|
# Clean up the title of the RSS & Calendar
|
||
4 years ago
|
title_check = title.lower().strip().replace('\n','')
|
||
|
rss_title_check = post["title"].lower().strip().replace('\n','')
|
||
4 years ago
|
|
||
4 years ago
|
if title_check == rss_title_check:
|
||
4 years ago
|
|
||
4 years ago
|
os.system("toilet --gay -w 125 -W --filter border:gay \ \ \ COMING UP\ \ \ \ ")
|
||
|
print("")
|
||
|
time.sleep(1)
|
||
|
|
||
|
description = pypandoc.convert_text(post["summary"], 'plain', format='html',extra_args=['--columns=64'])
|
||
4 years ago
|
|
||
|
# Send the event to the terminal·
|
||
4 years ago
|
|
||
|
# Title
|
||
|
os.system(f"toilet -f big --gay -w 125 '{ title }'")
|
||
4 years ago
|
print("")
|
||
|
time.sleep(1)
|
||
|
|
||
4 years ago
|
# Date
|
||
4 years ago
|
print(date.strftime("%A %d %B %Y (%H:%M:%S)"))
|
||
|
print("")
|
||
|
time.sleep(1)
|
||
|
|
||
4 years ago
|
# Description
|
||
4 years ago
|
lines = [line for line in description.split('\n')]
|
||
|
for line in lines:
|
||
|
# HACKY!!!
|
||
4 years ago
|
line = line.replace('\n', '')
|
||
|
#line = line.replace('(', '(')
|
||
|
#line = line.replace(')', ')')
|
||
|
#line = line.replace(';', '\;')
|
||
|
#line = line.replace('"', '\"')
|
||
|
#line = line.replace("'", "\'")
|
||
|
os.system(f"echo '{ line }' | lolcat -a -d 1")
|
||
4 years ago
|
print("")
|
||
4 years ago
|
time.sleep(3)
|