Пример #1
0
def readCharacterInformation(html):
    responseCharacterData = {}
    pattern = re.compile(r'Character Information')
    characterData = html.find(text=pattern).parent.parent.parent.parent
    for data in characterData:
        text = encodeString(data.get_text())
        twoPointsIndex = text.find(':')
        responseCharacterData[camelize(
            text[:twoPointsIndex])] = text[twoPointsIndex + 1:]
    return responseCharacterData
Пример #2
0
def readCharacterDeathInformation(html):
    responseCharacterData = []
    pattern = re.compile(r'Character Deaths')
    characterDeathData = html.find(text=pattern).parent.parent.parent.parent
    for data in characterDeathData:
        text = encodeString(data.get_text())
        cetIndex = text.find('CET')
        if cetIndex > 1:
            responseCharacterData.append({
                'date': text[:cetIndex + 3],
                'killedByMessage': text[cetIndex + 3:]
            })
    return responseCharacterData
Пример #3
0
def readOnlinePlayers(html):
    responseCharactersOnline = []
    referenceContent = html.findAll("tr", {"class": "LabelH"})
    onlinePlayersTable = referenceContent[0].parent.find_all('tr')
    for playerRow in onlinePlayersTable:
        characterDataDic = {}
        count = 0
        cols = playerRow.find_all('td')
        for characterData in cols:
            text = encodeString(characterData.get_text())
            if count == 0:
                print(count)
                characterDataDic['name'] = text
            elif count == 1:
                print(count)
                characterDataDic['level'] = text
            elif count == 2:
                print(count)
                characterDataDic['vocation'] = text
            responseCharactersOnline.append(characterDataDic)
            count += 1
    return responseCharactersOnline
Пример #4
0
 def visitStringLiteral(self, node):
     self._write(utils.encodeString(node.value))
Пример #5
0
def readGuildInformation(html):
    guildData = {}
    guildInformation = html.find('div', {'id': 'GuildInformationContainer'})
    guildData['guildInformation'] = encodeString(guildInformation.get_text())
    return guildData
Пример #6
0
 def visitStringLiteral(self, node):
     self._write(utils.encodeString(node.value))
Пример #7
0
 def data(self):
     return utils.encodeString(self.value)
Пример #8
0
 def __repr__(self):
     return "StringLiteral(%s)" % utils.encodeString(self.value)
Пример #9
0
 def data(self):
     return utils.encodeString(self.value)
Пример #10
0
 def __repr__(self):
     return "AstStringLiteral(%s)" % utils.encodeString(self.value)