diff --git a/README.md b/README.md index 936646c..68c1c4b 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Finally, the title text string and colour at the top can be changed, although th * Up to 99 subpages are written. * Emoji stripping is now included. Mostly. * URLs are stripped and replaced with the placeholder [LINK] -* Due to the limited teletext character set substitutions are implemented. Things like replacing underscores with hyphens and also making sure # works correctly. You also have to replace curly apostrophes with straight ones, as that's all the specification allows +* Level 1.5 teletext is supported - meaning more characters are now supported! There you go, Europeans! Apart from those notes, things should work ok. Have fun, turn back the clock, and if you genuinely use this for anything please let me know (also you're mental/cool). diff --git a/changelog.md b/changelog.md index bf02915..6231d87 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ ## Changelog +## v1.1.0 +- a major update! alistair cree had added level 1.5 teletext support + this effectively means that more characters are supported. Europe rejoice! + ### v1.0.4 - added query highlighting in search mode diff --git a/teletext-twitter/__main__.py b/teletext-twitter/__main__.py index 109d485..5d6baca 100644 --- a/teletext-twitter/__main__.py +++ b/teletext-twitter/__main__.py @@ -26,7 +26,7 @@ def parse_args(): parser.add_argument("-c", "--count", type=int, default=5, help="number of tweets to download (default is 5, capped at 200)") parser.add_argument("-d", "--delay", type=int, default=60, help="seconds between timeline scrapes (default is 60 seconds - lower values have no effect)") parser.add_argument("-n", "--no-repeat", action="store_true", default=False, help="only download tweets once - overrules -d switch") - parser.add_argument("-v", "--version", action="version", version="1.0.4") + parser.add_argument("-v", "--version", action="version", version="1.1.0") parser.add_argument("-Q", "--quiet", action="store_true", default=False, help="suppresses all output to the terminal except warnings and errors") args = parser.parse_args() @@ -47,6 +47,7 @@ def main(): if not args.quiet: print("[*] teletext-twitter - (c) 2018 Mark Pentler (https://github.com/mpentler)", file=sys.stdout) + print("[*] additional support by Alistair Cree (https://zxnet.co.uk)", file=sys.stdout) while True: try: diff --git a/teletext-twitter/output.py b/teletext-twitter/output.py index 8debf72..a1f50d1 100644 --- a/teletext-twitter/output.py +++ b/teletext-twitter/output.py @@ -131,7 +131,7 @@ def write_tweets(twitter_object, mode, count, config, query=None): # grab the la subpage_enhancements += tweet_text_line[1] write_tweet_line(file, line_position, tweet_text_line[0], config) line_position += 1 - + # finish the last subpage with open(filename, "a", newline="") as file: file.write("FL,0,0,0,0,0,100\r\n") diff --git a/teletext-twitter/processor.py b/teletext-twitter/processor.py index 40a0dfd..1e129ef 100644 --- a/teletext-twitter/processor.py +++ b/teletext-twitter/processor.py @@ -41,7 +41,7 @@ def charsub(text): text = text.replace("dž", "dž") text = text.replace("<", "<") text = text.replace(">", ">") - + # these could be enhanced but this will save packets text = text.replace("’", "'") text = text.replace("‘", "'") @@ -51,7 +51,6 @@ def charsub(text): enhancementmapping = { # map to L1 replacement character, enhancement mode, enhancement data - "£":[0x23,0,0], "–":[0x60,0,0], "—":[0x60,0,0], @@ -67,46 +66,45 @@ def charsub(text): "|":[0x7c,0x10,0x7c], "}":[0x29,0x10,0x7d], "~":[0x7f,0x10,0x7e], - + # grave "À":[0x41,0x11,0x41],"à":[0x61,0x11,0x61],"È":[0x45,0x11,0x45],"è":[0x65,0x11,0x65],"Ì":[0x49,0x11,0x49],"ì":[0x69,0x11,0x69],"Ò":[0x4F,0x11,0x4F],"ò":[0x6F,0x11,0x6F],"Ù":[0x55,0x11,0x55],"ù":[0x75,0x11,0x75],"Ǹ":[0x4E,0x11,0x4E],"ǹ":[0x6E,0x11,0x6e],"Ẁ":[0x57,0x11,0x57],"ẁ":[0x77,0x11,0x77],"Ỳ":[0x59,0x11,0x59],"ỳ":[0x79,0x11,0x79], - + # acute "Á":[0x41,0x12,0x41],"á":[0x61,0x12,0x61],"Ć":[0x43,0x12,0x43],"ć":[0x63,0x12,0x63],"É":[0x45,0x12,0x45],"é":[0x65,0x12,0x65],"Í":[0x49,0x12,0x49],"í":[0x69,0x12,0x69],"Ĺ":[0x4c,0x12,0x4c],"ĺ":[0x6c,0x12,0x6c],"Ń":[0x4e,0x12,0x4e],"ń":[0x6e,0x12,0x6e],"Ó":[0x4f,0x12,0x4f],"ó":[0x6f,0x12,0x6f],"Ŕ":[0x52,0x12,0x52],"ŕ":[0x72,0x12,0x72],"Ś":[0x53,0x12,0x53],"ś":[0x73,0x12,0x73],"Ú":[0x55,0x12,0x55],"ú":[0x75,0x12,0x75],"Ŵ":[0x57,0x12,0x57],"ŵ":[0x77,0x12,0x77],"Ý":[0x59,0x12,0x59],"ý":[0x79,0x12,0x79],"Ź":[0x5a,0x12,0x5a],"ź":[0x7a,0x12,0x7a], - + # circumflex "Â":[0x41,0x13,0x41],"â":[0x61,0x13,0x61],"Ê":[0x45,0x13,0x45],"ê":[0x65,0x13,0x65],"Î":[0x49,0x13,0x49],"î":[0x69,0x13,0x69],"Ô":[0x4f,0x13,0x4f],"ô":[0x6f,0x13,0x6f],"Û":[0x55,0x13,0x55],"û":[0x75,0x13,0x75],"Ŵ":[0x57,0x13,0x57],"ŵ":[0x77,0x13,0x77],"Ý":[0x59,0x13,0x59],"ý":[0x79,0x13,0x79], - + # tilde "Ã":[0x41,0x14,0x41],"ã":[0x61,0x14,0x61],"Ñ":[0x4e,0x14,0x4e],"ñ":[0x6e,0x14,0x6e],"Õ":[0x4f,0x14,0x4f],"õ":[0x6f,0x14,0x6f], - + # macron "Ā":[0x41,0x15,0x41],"ā":[0x61,0x15,0x61],"Ē":[0x45,0x15,0x45],"ē":[0x65,0x15,0x65],"Ī":[0x49,0x15,0x49],"ī":[0x69,0x15,0x69],"Ū":[0x55,0x15,0x55],"ū":[0x75,0x15,0x75], - + # breve "Ă":[0x41,0x16,0x41],"ă":[0x61,0x16,0x61],"Ĕ":[0x45,0x16,0x45],"ĕ":[0x65,0x16,0x65],"Ĭ":[0x49,0x16,0x49],"ĭ":[0x69,0x16,0x69],"Ŏ":[0x4f,0x16,0x4f],"ŏ":[0x6f,0x16,0x6f],"Ŭ":[0x55,0x16,0x55],"ŭ":[0x75,0x16,0x75],"Ğ":[0x47,0x16,0x47],"ğ":[0x67,0x16,0x67], - + # dot "Ė":[0x45,0x17,0x45],"ė":[0x65,0x17,0x65],"Ż":[0x5a,0x17,0x5a],"ż":[0x7a,0x17,0x7a], - + # diaeresis/umlaut "Ä":[0x41,0x18,0x41],"ä":[0x61,0x18,0x61],"Ë":[0x45,0x18,0x45],"ë":[0x65,0x18,0x65],"Ï":[0x49,0x18,0x49],"ï":[0x69,0x18,0x69],"Ö":[0x4f,0x18,0x4f],"ö":[0x6f,0x18,0x6f],"Ü":[0x55,0x18,0x55],"ü":[0x75,0x18,0x75],"Ẅ":[0x57,0x18,0x57],"ẅ":[0x77,0x18,0x77],"Ÿ":[0x59,0x18,0x59],"ÿ":[0x79,0x18,0x79], - + # ring "Å":[0x41,0x1a,0x41],"Å":[0x41,0x1a,0x41],"å":[0x61,0x1a,0x61],"Ů":[0x55,0x1a,0x55],"ů":[0x75,0x1a,0x75], - + # cedilla/comma,hook "Ç":[0x43,0x1b,0x43],"ç":[0x63,0x1b,0x63],"Ķ":[0x4b,0x1b,0x4b],"ķ":[0x6b,0x1b,0x6b],"Ļ":[0x4c,0x1b,0x4c],"ļ":[0x6c,0x1b,0x6c],"Ņ":[0x4e,0x1b,0x4e],"ņ":[0x6e,0x1b,0x6e],"Ş":[0x53,0x1b,0x53],"Ș":[0x53,0x1b,0x53],"ş":[0x73,0x1b,0x73],"ș":[0x73,0x1b,0x73],"Ț":[0x54,0x1b,0x54],"ț":[0x74,0x1b,0x74], - + # double acute "A̋":[0x41,0x1d,0x41],"a̋":[0x61,0x1d,0x61],"Ő":[0x4f,0x1d,0x4f],"ő":[0x6f,0x1d,0x6f],"Ű":[0x55,0x1d,0x55],"ű":[0x75,0x1d,0x75], - + # ogonek "Ą":[0x41,0x1e,0x41],"ą":[0x61,0x1e,0x61],"Ę":[0x45,0x1e,0x45],"ę":[0x65,0x1e,0x65],"Į":[0x49,0x1e,0x49],"į":[0x69,0x1e,0x69],"Ų":[0x55,0x1e,0x55],"ų":[0x75,0x1e,0x75], - + # caron/háček "Č":[0x43,0x1f,0x43],"č":[0x63,0x1f,0x63],"Ď":[0x44,0x1f,0x44],"ď":[0x64,0x1f,0x64],"Ě":[0x45,0x1f,0x45],"ě":[0x65,0x1f,0x65],"Ľ":[0x4c,0x1f,0x4c],"ľ":[0x6c,0x1f,0x6c],"Ň":[0x4e,0x1f,0x4e],"ň":[0x6e,0x1f,0x6e],"Ř":[0x52,0x1f,0x52],"ř":[0x72,0x1f,0x72],"Š":[0x53,0x1f,0x53],"š":[0x73,0x1f,0x73],"Ť":[0x54,0x1f,0x54],"ť":[0x74,0x1f,0x74],"Ž":[0x5a,0x1f,0x5a],"ž":[0x7a,0x1f,0x7a], - "¡":[0x21,0x0F,0x21], "¢":[0x63,0x0F,0x22], "¥":[0x59,0x0F,0x25], @@ -135,7 +133,6 @@ def charsub(text): "Œ":[0x7f,0x0F,0x6a], "œ":[0x7f,0x0F,0x7a], "ß":[0x73,0x0F,0x7b], - #todo: more mappings }