MCPcopy Create free account
hub / github.com/decodableco/examples / poll

Function poll

tinybird/wiki.py:15–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 return boto3.client('kinesis',region_name=os.getenv("REGION"))
14
15def poll():
16 feed=feedparser.parse('https://en.wikipedia.org/w/api.php?action=feedrecentchanges')
17 entries = feed['entries']
18 stream = os.getenv("KINESIS_STREAM")
19 k = kinesis()
20
21 for e in entries:
22 print(json.dumps(e))
23 k.put_record(
24 StreamName=stream,
25 Data=json.dumps(e),
26 PartitionKey="-1")
27
28def main():
29 load_dotenv()

Callers 1

mainFunction · 0.70

Calls 1

kinesisFunction · 0.85

Tested by

no test coverage detected