Skip to content

Instantly share code, notes, and snippets.

@empeje
Last active April 8, 2023 21:15
Show Gist options
  • Save empeje/2ee9b44d0e20839ea205730e089f81c4 to your computer and use it in GitHub Desktop.
Save empeje/2ee9b44d0e20839ea205730e089f81c4 to your computer and use it in GitHub Desktop.
Zapier

Zapier script for script kiddies.

import requests
response = requests.get('https://newsletter.banklesshq.com/feed')
response.raise_for_status() # optional but good practice in case the call fails!
from xml.etree import ElementTree
root = ElementTree.fromstring(response.text)
content = ""
# Looks for all item elements under channel tag
for item in root.iterfind('channel/item'):
title = item.findtext('title')
description = item.findtext('description')
date = item.findtext('pubDate')
link = item.findtext('link')
header = ('%s / %s / %s \n' %(title, date, description))
content += header
output = { content: content }
print(content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment