mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Support WOTA alerts, need to see a spot before we can support spots properly. #63
This commit is contained in:
23
spotproviders/wota.py
Normal file
23
spotproviders/wota.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user