mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
24 lines
735 B
Python
24 lines
735 B
Python
import re
|
|
|
|
from rss_parser import RSSParser
|
|
|
|
from spotproviders.http_spot_provider import HTTPSpotProvider
|
|
|
|
|
|
# Spot provider for Wainwrights on the Air
|
|
class WOTA(HTTPSpotProvider):
|
|
POLL_INTERVAL_SEC = 120
|
|
SPOTS_URL = "https://www.wota.org.uk/spots_rss.php"
|
|
|
|
def __init__(self, provider_config):
|
|
super().__init__(provider_config, self.SPOTS_URL, self.POLL_INTERVAL_SEC)
|
|
|
|
def http_response_to_spots(self, http_response):
|
|
new_spots = []
|
|
rss = RSSParser.parse(http_response.content.decode())
|
|
# Iterate through source data
|
|
for source_alert in rss.channel.items:
|
|
break
|
|
# TODO: Need to see a live spot to know what this feed looks like
|
|
return new_spots
|