Ejemplo n.º 1
0
def parse_for_songs(url):
    print 'Getting songs from ', url
    r = requests.get(url)
    soup = BeautifulSoup(r.content)
    band_tags = soup.find_all(is_band_tag)
    songs = []
    for band in band_tags:
        band_text = band.text.strip()
        band_names = band_text.split('|')
        for band_name in band_names:
            #      print band_name
            band_name = band_name.strip()
            albums = spotifier.get_albums_for_artist(band_name)
            if len(albums) == 0:
                continue
            print 'Band: {} -- Found {} albums'.format(band_name, len(albums))
            for album in albums:
                tracks = spotifier.get_album_tracks(album['id'])
                if len(tracks) < 1:
                    continue
                songs.append({'uri': tracks[0]['uri']})
                break

    page_title = 'ROCK_HOTEL'
    return songs, page_title
Ejemplo n.º 2
0
def parse_for_songs(url):
  print 'Getting songs from ', url
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band_tag)
  songs = []
  for band in band_tags:
    band_text = band.text.strip()
    band_names = band_text.split(',')
    for band_name in band_names:
      #print band_name
      band_name = band_name.strip()
      albums = spotifier.get_albums_for_artist(band_name)
      if len(albums) == 0:
        continue
      print 'Band: {} -- Found {} albums'.format(band_name, len(albums))
      for album in albums:
        tracks = spotifier.get_album_tracks(album['id'])
        if len(tracks) < 1:
          continue
        songs.append({'uri': tracks[0]['uri']})
        break

  page_title = 'U_STREET'
  return songs, page_title
Ejemplo n.º 3
0
def parse_for_songs(url):
    print 'Getting songs from ', url
    r = requests.get(url)
    soup = BeautifulSoup(r.content)
    band_tags = soup.find_all(is_band_tag)
    songs = []
    for band in band_tags:
        #    print band
        band_name_raw = band.text
        if band_name_raw == 'Tickets' or band_name_raw == 'More Info':
            continue
        band_names = [name.strip() for name in band_name_raw.split(',')]
        #    artists = spotifier.fetch_artist(band_name)
        #    print artists
        for band_name in band_names:
            print band_name
            albums = spotifier.get_albums_for_artist(band_name)
            if len(albums) == 0:
                continue
    #    print 'Found {} albums'.format(len(albums))
            for album in albums:
                tracks = spotifier.get_album_tracks(album['id'])
                if len(tracks) < 1:
                    continue
                songs.append({'uri': tracks[0]['uri']})
                break

    page_title = 'CATSCRADLE'
    return songs, page_title
def parse_for_songs(url):
  print 'Getting songs from ', url
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band_tag)
  songs = []
  for band in band_tags:
#    print band
    band_name_raw = band.text
    if band_name_raw == 'Tickets' or band_name_raw =='More Info':
      continue
    band_names = [name.strip() for name in band_name_raw.split(',')]
#    artists = spotifier.fetch_artist(band_name)
#    print artists
    for band_name in band_names:
      print band_name
      albums = spotifier.get_albums_for_artist(band_name)
      if len(albums) == 0:
        continue
  #    print 'Found {} albums'.format(len(albums))
      for album in albums:
        tracks = spotifier.get_album_tracks(album['id'])
        if len(tracks) < 1:
          continue
        songs.append({'uri': tracks[0]['uri']})
        break

  page_title = 'CATSCRADLE'
  return songs, page_title
Ejemplo n.º 5
0
def parse_for_songs(url):
    print 'Getting songs from ', url
    r = requests.get(url)
    soup = BeautifulSoup(r.content)
    band_tags = soup.find_all(is_band_tag)
    songs = []
    for band in band_tags:
        band_name = band.text
        #print band_name
        #    artists = spotifier.fetch_artist(band_name)
        #    print artists
        albums = spotifier.get_albums_for_artist(band_name)
        print 'Found {} albums'.format(len(albums))

    page_title = 'BLACKCAT'
    return songs, page_title
Ejemplo n.º 6
0
def parse_for_songs(url):
  print 'Getting songs from ', url
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band_tag)
  songs = []
  for band in band_tags:
    band_name = band.text
    #print band_name
#    artists = spotifier.fetch_artist(band_name)
#    print artists
    albums = spotifier.get_albums_for_artist(band_name)
    print 'Found {} albums'.format(len(albums))

  page_title = 'BLACKCAT'
  return songs, page_title
def parse_for_songs(url):
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band)
  songs = []
  bands = []
  for tag in band_tags:
    band_name = tag.text.strip()
    albums = spotifier.get_albums_for_artist(band_name)
    if len(albums) == 0:
      continue
    print '\tBand: {} -- Found {} albums'.format(band_name, len(albums))
    for album in albums:
      tracks = spotifier.get_album_tracks(album['id'])
      if len(tracks) < 1:
        continue
      songs.append({'uri': tracks[0]['uri']})
      break

  page_title = 'ROCKNESS'
  return songs, page_title
Ejemplo n.º 8
0
def parse_for_songs(url):
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band)
  songs = []
  bands = []
  for tag in band_tags:
    band_name = tag.text.strip()
    albums = spotifier.get_albums_for_artist(band_name)
    if len(albums) == 0:
      continue
    print '\tBand: {} -- Found {} albums'.format(band_name, len(albums))
    for album in albums:
      tracks = spotifier.get_album_tracks(album['id'])
      if len(tracks) < 1:
        continue
      songs.append({'uri': tracks[0]['uri']})
      break

  page_title = 'SXSW'
  return songs, page_title
Ejemplo n.º 9
0
def parse_for_songs(url):
  print 'Getting songs from ', url
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band_tag)
  songs = []
  cleaned_band_names = []
  for band in band_tags:
    band_text = band.text.strip()
    band_names = band_text.split(',')
    cleaned_band_names.extend(band_names)
    for band_name in band_names:
      band_name = band_name.strip()
      if band_name.startswith('and '):
        band_name = band_name[4:]
      band_name = band_name.replace('(Record Release)', '')
      band_name = band_name.strip()
      cleaned_band_names.append(band_name)
      more_names = band_name.split('w/')
      for new_one in more_names:
        cleaned_band_names.append(new_one)
        #print '\t' + new_one

  for band_name in set(cleaned_band_names):
    band_name = band_name.strip()
    #print band_name
    albums = spotifier.get_albums_for_artist(band_name)
    if len(albums) == 0:
      continue
    print '\tBand: {} -- Found {} albums'.format(band_name, len(albums))
    for album in albums:
      tracks = spotifier.get_album_tracks(album['id'])
      if len(tracks) < 1:
        continue
      songs.append({'uri': tracks[0]['uri']})
      break

  page_title = 'COMET'
  return songs, page_title
Ejemplo n.º 10
0
def parse_for_songs(url):
    print 'Getting songs from ', url
    r = requests.get(url)
    soup = BeautifulSoup(r.content)
    band_tags = soup.find_all(is_band_tag)
    songs = []
    cleaned_band_names = []
    for band in band_tags:
        band_text = band.text.strip()
        band_names = band_text.split(',')
        cleaned_band_names.extend(band_names)
        for band_name in band_names:
            band_name = band_name.strip()
            if band_name.startswith('and '):
                band_name = band_name[4:]
            band_name = band_name.replace('(Record Release)', '')
            band_name = band_name.strip()
            cleaned_band_names.append(band_name)
            more_names = band_name.split('w/')
            for new_one in more_names:
                cleaned_band_names.append(new_one)
                #print '\t' + new_one

    for band_name in set(cleaned_band_names):
        band_name = band_name.strip()
        #print band_name
        albums = spotifier.get_albums_for_artist(band_name)
        if len(albums) == 0:
            continue
        print '\tBand: {} -- Found {} albums'.format(band_name, len(albums))
        for album in albums:
            tracks = spotifier.get_album_tracks(album['id'])
            if len(tracks) < 1:
                continue
            songs.append({'uri': tracks[0]['uri']})
            break

    page_title = 'COMET'
    return songs, page_title
Ejemplo n.º 11
0
def parse_for_songs(url):
  print 'Getting songs from ', url
  r = requests.get(url)
  soup = BeautifulSoup(r.content)
  band_tags = soup.find_all(is_band_tag)
  songs = []
  for band in band_tags:
    band_name = band.text
    #print band_name
#    artists = spotifier.fetch_artist(band_name)
#    print artists
    albums = spotifier.get_albums_for_artist(band_name)
    if len(albums) == 0:
      continue
#    print 'Found {} albums'.format(len(albums))
    for album in albums:
      tracks = spotifier.get_album_tracks(album['id'])
      if len(tracks) < 1:
        continue
      songs.append({'uri': tracks[0]['uri']})
      break

  page_title = 'BLACKCAT'
  return songs, page_title
Ejemplo n.º 12
0
def parse_for_songs(url):
    print 'Getting songs from ', url
    r = requests.get(url)
    soup = BeautifulSoup(r.content)
    band_tags = soup.find_all(is_band_tag)
    songs = []
    for band in band_tags:
        band_name = band.text
        #print band_name
        #    artists = spotifier.fetch_artist(band_name)
        #    print artists
        albums = spotifier.get_albums_for_artist(band_name)
        if len(albums) == 0:
            continue
#    print 'Found {} albums'.format(len(albums))
        for album in albums:
            tracks = spotifier.get_album_tracks(album['id'])
            if len(tracks) < 1:
                continue
            songs.append({'uri': tracks[0]['uri']})
            break

    page_title = 'BLACKCAT'
    return songs, page_title