Last active
September 23, 2016 16:16
-
-
Save jsundram/b15fea867666ff5fd5928af6ecc46ec1 to your computer and use it in GitHub Desktop.
Get top presenters from Boston Musical Intelligencer to figure out what series there may be to subscribe to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import bs4 | |
import requests | |
p = requests.get('http://www.classical-scene.com/calendar/') | |
s = bs4.BeautifulSoup(p.content, "lxml") | |
presenters = s.select('.presenter > a') | |
c = Counter(p.text for p in performers) | |
# At least 4 concerts to be considered for a series subscription. | |
items = [i for i in c.most_common() if 4 < i[1]] | |
longest = max(len(k) for (k, v) in items) | |
for (k, v) in items: | |
print(u"{0:<{1}}\t({2:>2} concerts)".format(k, longest, v)) | |
# Output: | |
""" | |
Boston Symphony Orchestra (33 concerts) | |
Emmanuel Music (18 concerts) | |
Isabella Stewart Gardner Museum (16 concerts) | |
New England Conservatory (15 concerts) | |
Boston Conservatory (S) (14 concerts) | |
Boston Civic Symphony (10 concerts) | |
Boston Artists Ensemble (10 concerts) | |
Boston Philharmonic ( 9 concerts) | |
Longy School of Music ( 9 concerts) | |
Chameleon Arts Ensemble ( 8 concerts) | |
King’s Chapel ( 8 concerts) | |
Boston Baroque ( 7 concerts) | |
New Philharmonia ( 7 concerts) | |
Handel and Haydn Society ( 7 concerts) | |
Boston Chamber Music Society (S) ( 6 concerts) | |
St. Paul’s Parish ( 5 concerts) | |
Celebrity Series ( 5 concerts) | |
Boston Conservatory (T) ( 5 concerts) | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment