Skip to content

Commit

Permalink
adds townscript
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Apr 1, 2024
1 parent 3def0d8 commit 1642b0c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ out/zomato.json:
python src/zomato.py

out/bic.json:
python src/ics-to-event.py out/bic.ics out/bic.json
python src/ics-to-event.py out/bic.ics out/bic.json

out/sofar.json:
python src/sofar.py

out/sumukha.json:
python src/sumukha.py

out/townscript.txt:
python src/townscript.py | sort > out/townscript.txt

all: out/allevents.txt \
out/highape.txt \
out/mapindia.json \
Expand All @@ -83,7 +86,8 @@ all: out/allevents.txt \
out/atta_galatta.json \
out/bic.json \
out/sumukha.json \
out/sofar.json
out/sofar.json \
out/townscript.txt
@echo "Done"

db:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ We either have URLs that can be easily scraped (https://schema.org/Event), or a
| [NGMA][ngma] |||| OCR The [older website calender](http://www.ngmaindia.gov.in/ngma_bangaluru_calendar.asp) is not updated. |
| [Sofar][sofar] | ✔️ | ✔️ | ✔️ | |
| [Sumukha gallery][sumukha] | ✔️ | ✔️ | ✔️ |
| [Townscript][ts] | ✔️ | ✔️ | ✔️ | Lahe Lahe, Broke Bibliophiles, Foodwize

# WIP

Expand All @@ -39,9 +40,7 @@ We have some data available or change notifications configured, but there needs
- [ ] [Instagram](instagram.txt)
- [ ] http://1shanthiroad.com/category/events/
- [ ] https://gullytours.vacationlabs.com/ -> Go to booking page to see valid dates. Couldn't find any other "good" vacationlabs domains.
- [ ] https://www.townscript.com/o/lahe
- [ ] https://www.townscript.com/o/priya-joshi-322244 -> Also find more TS accounts to follow
- [ ] https://www.townscript.com/o/abhiram-r-401313
- [ ] find more Townscript accounts to follow
- [ ] https://www.tonight.is/. Some GRPC Firebase :poop:
- [ ] https://www.downtomeet.com/
- [ ] Go through PS archives to see other venue hosts.
Expand All @@ -59,4 +58,5 @@ We have some data available or change notifications configured, but there needs

[vism]: https://www.vismuseum.gov.in/special_events/upcoming-events-2/
[sofar]: https://www.sofarsounds.com/cities/bangalore
[sumukha]: https://sumukha.com
[sumukha]: https://sumukha.com
[ts]: https://www.townscript.com/
10 changes: 7 additions & 3 deletions in/known-hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ luma:
# TWIF has events all across globe
# thisweekinfintech: twif
townscript:
lahe-lahe: lahe
foodwize: priya-joshi-322244
broke-bibliophiles: abhiram-r-401313
lahe-lahe:
id: "2033748"
foodwize:
id: "4527655"
broke-bibliophiles:
id: "1306109"
superEvent: https://www.townscript.com/o/abhiram-r-401313
instagram:
- amiel_gourmet
- uskbengaluru
Expand Down
20 changes: 20 additions & 0 deletions src/townscript.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import yaml
import json
import http.client

def get_event_urls(org_id):
conn = http.client.HTTPSConnection("www.townscript.com")
conn.request("GET", f"/listings/event/upcoming/userId/{org_id}")
response = conn.getresponse()
d = response.read().decode()
for e in json.loads(d)['data']:
yield f"https://www.townscript.com/e/{e['shortName']}"

def main():
config = yaml.safe_load(open('in/known-hosts.yml'))['townscript']
for c in config:
for e in get_event_urls(config[c]['id']):
print(e)

if __name__ == "__main__":
main()

0 comments on commit 1642b0c

Please sign in to comment.