๐พ Archived View for m0yng.uk โบ 2020 โบ 08 โบ APRS-to-Mastodon captured on 2021-12-04 at 18:04:22. Gemini links have been rewritten to link to archived content
โฌ ๏ธ Previous capture (2021-12-03)
โก๏ธ Next capture (2022-01-08)
-=-=-=-=-=-=-
Created 2020-08-08
Who doesn't want to post messages to a social network using APRS?
It's an idea I've been not-really working on for a while, and I've had various iterations.
One would watch the log files of `APRX` and toot weather reports heard off the air.
This one connects to the APRS Internet Stream and lets people send an APRS message to `M0YNG-15`, then have it tooted by @APRSBot[1] (it toots "Followers only" so it might appear silent.)
1: https://mastodon.radio/@aprsbot
The code is fairly simple, and almost certainly has issues!
#!/usr/bin/env python3 """ APRS -> Fediverse gateway Maybe. M0YNG 2020 """ # imports (obviously) import aprslib import configparser from mastodon import Mastodon # Load the config config = configparser.ConfigParser() config.read('config.ini') # hashes of already tooted messages pastToots = [] # connect to mastodon mastodonBot = Mastodon( access_token=config['mastodon']['access_token'], api_base_url=config['mastodon']['app_url'] ) # function to check and toot APRS packets def callback(packet): if 'addresse' in packet and packet['addresse'] == config['aprs']['callsign'] and packet['format'] == 'message': # Construct toot text tootText = 'From ' + str(packet['from']) + ' via ' + \ str(packet['path']) + '\n\n' + packet['message_text'] tootHash = hash(tootText) if tootHash not in pastToots: # log it print(tootText) # toot it postedToot = mastodonBot.status_post(tootText) # log it print(postedToot['url'] + '\n') # record it pastToots.append(tootHash) # let the user know it worked AIS.sendall(config['aprs']['callsign'] + '>APRS,TCPIP*::'+str(packet['from']) + ' : Message tooted!') else: print('Already tooted this message') # connect to the stream AIS = aprslib.IS(config['aprs']['callsign'], passwd=config['aprs']['passcode']) AIS.connect() # do something with each packet AIS.consumer(callback)
[mastodon] access_token = youraccesstoken app_url = https://your.domain.here [aprs] callsign = callsign-ssid passcode = passcodde
Things this could do;
-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-
๐ค Black Lives Matter
๐๐ค๐ Trans Rights are Human Rights
โค๏ธ๐งก๐๐๐๐ Love is Love
Copyright ยฉ 2021 Christopher M0YNG
Code snippets are licenced under the Hippocratic License 3.0 (or later.)
Page generated 2021-11-02 by Complex 19