Skip to content

Commit

Permalink
sofar: Fix parser for secret events
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Jul 16, 2024
1 parent a55e60e commit bec6599
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
10 changes: 9 additions & 1 deletion out/sofar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 18 additions & 10 deletions patch/sofar.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"@context": "https://schema.org",
"@type": "MusicEvent",
"eventStatus": "EventScheduled",
"organizer": {
"@type": "Organization",
"name": "Sofar Sounds",
"url": "https://www.sofarsounds.com/"
},
"keywords": ["SOFAR"]
}
"@context": "https://schema.org",
"@type": "MusicEvent",
"eventStatus": "EventScheduled",
"organizer": {
"@type": "Organization",
"name": "Sofar Sounds",
"url": "https://www.sofarsounds.com/"
},
"keywords": ["SOFAR"],
"offers": [
{
"@type": "Offer",
"price": "800",
"priceCurrency": "INR",
"availability": "https://schema.org/InStock"
}
]
}
6 changes: 5 additions & 1 deletion src/sofar.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def to_schema_org_music_event(event_info):
# events are assumed to be 2 hours long
endsAt = startsAt + datetime.timedelta(hours=2)

name = event_info["theme"]["title"] + " Sofar concert at a "
print(event_info)
try:
name = event_info["theme"]["title"] + " Sofar concert at a "
except:
name = "Sofar concert"

categories = "/".join([x["name"] for x in event_info["venue"]["venueCategories"]])
if categories != "Other":
Expand Down

0 comments on commit bec6599

Please sign in to comment.