Bunch of small scripts to run a temporary radio stream, automatically. Some liquidsoap, some bash, some pyhton. Combine as if you like Unix. with pipes
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.

24 lines
576 B

#this script splits text on space with a maximum of 240 characters
#but on whole words. because icy_medata has a max of 255 characters.
import sys
text = sys.stdin.readlines()
output = []
line = []
sentence = ""
for words in text:
for word in words.split():
if len(word) + len(" ".join(line)) < 240:
output.append(" ".join(line))
line = []
"#add the last word"
output.append(" ".join(line))
for line in output:
print(line.replace(',', ''))