Fix incosistent use of single and double quotes
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
import requests
|
||||
from datetime import datetime
|
||||
|
||||
listings = requests.get("https://roisindubh.net/remote/searchlistings.json").json()["results"]
|
||||
listings = requests.get('https://roisindubh.net/remote/searchlistings.json').json()['results']
|
||||
|
||||
# using several print statements to prioritise code readability over efficiency (I/O speeds are unimportant to me)
|
||||
print('<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">')
|
||||
@ -13,24 +13,24 @@ print('<channel><title>Roisín Dubh Listings</title><link>https://roisindubh.net
|
||||
|
||||
for listing in listings:
|
||||
print('<item>')
|
||||
print('<title>' + listing["pagetitle"] + '</title>')
|
||||
print('<link>https://roisindubh.net/listings/' + listing["alias"] + '</link>')
|
||||
print('<title>' + listing['pagetitle'] + '</title>')
|
||||
print('<link>https://roisindubh.net/listings/' + listing['alias'] + '</link>')
|
||||
|
||||
print('<description> <![CDATA[')
|
||||
print(listing["introtext"] + "\n" + listing["content"] + "\n")
|
||||
print(listing['introtext'] + '\n' + listing['content'] + '\n')
|
||||
|
||||
print('Location: ' + listing["name"] + '<br>')
|
||||
print('Ticket Allocation: ' + listing["ticket_allocation"] + '<br>')
|
||||
print('Tickets remaining?: ' + str(listing["ticket_remaining"] == '1') + '<br>')
|
||||
print('Event start time: ' + listing["event_date_time"] + '<br>')
|
||||
print('Late night?: ' + str(listing["late_night"] == "1") + '<br>')
|
||||
print('Postponed?: ' + str(listing["postponed"] == "1") + '<br>')
|
||||
print('Sales start time: ' + listing["sales_start"] + '<br>')
|
||||
print('On Sale?: ' + str(listing["on_sale"] == "1") + '<br>')
|
||||
print('Tickets remaining?: ' + str(listing["ticket_remaining"] == '1') + '<br>')
|
||||
print('Location: ' + listing['name'] + '<br>')
|
||||
print('Ticket Allocation: ' + listing['ticket_allocation'] + '<br>')
|
||||
print('Tickets remaining?: ' + str(listing['ticket_remaining'] == '1') + '<br>')
|
||||
print('Event start time: ' + listing['event_date_time'] + '<br>')
|
||||
print('Late night?: ' + str(listing['late_night'] == '1') + '<br>')
|
||||
print('Postponed?: ' + str(listing['postponed'] == '1') + '<br>')
|
||||
print('Sales start time: ' + listing['sales_start'] + '<br>')
|
||||
print('On Sale?: ' + str(listing['on_sale'] == '1') + '<br>')
|
||||
print('Tickets remaining?: ' + str(listing['ticket_remaining'] == '1') + '<br>')
|
||||
|
||||
if listing["external_ticket_url"]:
|
||||
print('External Ticket URL: <a href="' + listing["external_ticket_url"] + '">' + listing["external_ticket_url"] + '</a>')
|
||||
if listing['external_ticket_url']:
|
||||
print('External Ticket URL: <a href="' + listing['external_ticket_url'] + '">' + listing['external_ticket_url'] + '</a>')
|
||||
|
||||
# unparsed json object:
|
||||
# "prices": {
|
||||
@ -43,7 +43,7 @@ for listing in listings:
|
||||
# },
|
||||
|
||||
print(']]> </description>')
|
||||
print('<pubDate>' + datetime.strptime(listing["event_date_time"], '%Y-%m-%dT%H:%M:%S').strftime('%a, %d %b %Y %H:%M:%S %z') + '</pubDate>')
|
||||
print('<pubDate>' + datetime.strptime(listing['event_date_time'], '%Y-%m-%dT%H:%M:%S').strftime('%a, %d %b %Y %H:%M:%S %z') + '</pubDate>')
|
||||
print('</item>')
|
||||
|
||||
print('</channel></rss>')
|
||||
|
Reference in New Issue
Block a user