def __init__(self):
        '''  
            Constructor... 
        '''
        self.platformName = "Spotify"
        self.tags = ["social", "music"]

        ########################
        # Defining valid modes #
        ########################
        self.isValidMode = {}        
        self.isValidMode["phonefy"] = False
        self.isValidMode["usufy"] = True
        self.isValidMode["searchfy"] = False      
        
        ######################################
        # Search URL for the different modes #
        ######################################
        # Strings with the URL for each and every mode
        self.url = {}        
        #self.url["phonefy"] = "http://anyurl.com//phone/" + "<phonefy>"
        self.url["usufy"] = "http://open.spotify.com/user/"  + "<usufy>"       
        #self.url["searchfy"] = "http://anyurl.com/search/" + "<searchfy>"       

        ######################################
        # Whether the user needs credentials #
        ######################################
        self.needsCredentials = {}        
        #self.needsCredentials["phonefy"] = False
        self.needsCredentials["usufy"] = True
        #self.needsCredentials["searchfy"] = False 
        
        # Array of credentials to be used
        self.creds = []        
        
        #################
        # Valid queries #
        #################
        # Strings that will imply that the query number is not appearing
        self.validQuery = {}
        # The regular expression '.+' will match any query.
        #self.validQuery["phonefy"] = ".*"
        self.validQuery["usufy"] = ".+"
        #self.validQuery["searchfy"] = ".*"
        
        ###################
        # Not_found clues #
        ###################
        # Strings that will imply that the query number is not appearing
        self.notFoundText = {}
        #self.notFoundText["phonefy"] = []
        self.notFoundText["usufy"] = ["Página no encontrada"]
        #self.notFoundText["searchfy"] = []        
        
        #########################
        # Fields to be searched #
        #########################
        self.fieldsRegExp = {}
        
        # Definition of regular expressions to be searched in phonefy mode
        #self.fieldsRegExp["phonefy"] = {}
        # Example of fields:
        #self.fieldsRegExp["phonefy"]["i3visio.location"] = ""
        
        # Definition of regular expressions to be searched in usufy mode
        self.fieldsRegExp["usufy"] = {}
        # Example of fields:
        #self.fieldsRegExp["usufy"]["i3visio.location"] = ""
        # Definition of regular expressions to be searched in searchfy mode
        #self.fieldsRegExp["searchfy"] = {}
        # Example of fields:
        #self.fieldsRegExp["searchfy"]["i3visio.location"] = ""        
        
        ################
        # Fields found #
        ################
        # This attribute will be feeded when running the program.
        self.foundFields = {}
    

        def _doesTheUserExist(self, html):
                ''' 
                        Method that performs the verification of the existence or not of a given profile. This method has been rewritten as the standard notFoundText approach is not possible and we have to look for text that appears on VALID profiles.
                '''
                # this platform requires a special treatment, as we have been able to identify only characterized text that appears when a user exists
                userExistsText = ["<h3>Top Tracks</h3>"]
                # the traditional function is rewritten...
                for t in userExistsText:
                        if t in html:
                                return html
                return None
def __init__ ( self ) : self . platformName = "Spotify" self . tags = [ "social" , "music" ] self . isValidMode = { } self . isValidMode [ "phonefy" ] = False self . isValidMode [ "usufy" ] = True self . isValidMode [ "searchfy" ] = False self . url = { } self . url [ "usufy" ] = "http://open.spotify.com/user/" + "<usufy>" self . needsCredentials = { } self . needsCredentials [ "usufy" ] = True self . creds = [ ] self . validQuery = { } self . validQuery [ "usufy" ] = ".+" self . notFoundText = { } self . notFoundText [ "usufy" ] = [ "Página no encontrada" ] self . fieldsRegExp = { } self . fieldsRegExp [ "usufy" ] = { } self . foundFields = { } def _doesTheUserExist ( self , html ) : userExistsText = [ "<h3>Top Tracks</h3>" ] for t in userExistsText : if t in html : return html return None
Constructor...