def handle(self, show, uri): protocol, user_id = uri.split(':') profile_link = 'http://www.twitter.com/%s' % user_id name = parsing.get_name_from_title(profile_link, NAME_RE) artist_profile = ArtistProfile(system_id = 'twitter', profile_id = user_id, source_id = 'show-resource-handler:twitter', url = profile_link) return artist_matcher.associate_profile_with_matching_artist(show, name, artist_profile)
def handle(self, show, uri): protocol, user_id = uri.split(':') logger.debug('Fetching profile information for: %s' % user_id) profile = api.MySpaceProfile(user_id) artist_profile = ArtistProfile(system_id = 'myspace', profile_id = user_id, source_id = 'show-resource-handler:myspace', url = 'http://www.myspace.com/%s' % user_id) return artist_matcher.associate_profile_with_matching_artist(show, profile.get_name(), artist_profile)
def handle(self, show, uri): protocol, user_id = uri.split(':') logger.debug('Fetching profile information for: %s' % user_id) service = BandCampService(API_KEY) if user_id.isdigit(): band = service.get_band_by_id(user_id) else: band = service.get_band_by_url(user_id) artist_profile = ArtistProfile(system_id = SYSTEM_ID, profile_id = str(band.id), source_id = 'show-resource-handler:bandcamp', url = band.url) return artist_matcher.associate_profile_with_matching_artist(show, band.name, artist_profile)
def handle(self, show, uri): protocol, object_id = uri.split(':') logger.debug('Fetching facebook object: %s' % object_id) profile = GraphAPI().get_object(object_id) logging.debug('Item: %s' % profile) # Not all profiles have links if 'link' in profile: artist_profile = ArtistProfile(system_id = 'facebook', profile_id = profile['id'], source_id = 'show-resource-handler:facebook', url = profile['link']) return artist_matcher.associate_profile_with_matching_artist(show, profile['name'], artist_profile) else: return False