• Increase font size
  • Default font size
  • Decrease font size
joomla templates, wordpress themes, drupal, datalife engine, graphics, seo,

Adding Eve Contacts to Microsoft Outlook

E-mail Print PDF

I wrote this as a proof of concept. I don't know if it has a useful application, but I'd be willing to develop it into a full tool if there is any interest. I'm posting the example code for anyone who happens to be interested though. For this to work, you need to install pyWin32 and run makepy on the Microsoft Outlook 14.0 Object Library (explained in the linked article). Now keep in mind if you run this, it's not currently designed to do merging or error checking. If you run it twice, you get two copies of the characters. If you already have contacts in Outlook, these will merge with them. I'm really just posting it in case someone has a good idea for it.

import urllib
import xml.dom.minidom
import win32com.client
#This function grabs the text from a node.
def getText(node):
    for childNode in node.childNodes:
        if childNode.nodeType == childNode.TEXT_NODE:
#This function finds all the characters in a contact API list
#and adds them to the Characters dictionary that's passed in
def parseContactAPI(downloadedData, Characters):
    XMLData = xml.dom.minidom.parse(downloadedData)
    headerNodes = XMLData.getElementsByTagName("rowset")
    for headerNode in headerNodes:
        dataNodes = XMLData.getElementsByTagName("row")
        for dataNode in dataNodes:
            characterID = int(dataNode.attributes['contactID'].value)
            if not characterID in Characters:
                newCharacter = Character()
                newCharacter.CharacterID = characterID
                newCharacter.CharacterName = dataNode.attributes['contactName'].value
                newCharacter.Standing = float(dataNode.attributes['standing'].value)
                Characters[characterID] = newCharacter
#Class to hold the character information
class Character:
    def __init__(self):
        self.CharacterID = None
        self.CharacterName = None
        self.Standing = None
        self.CorporationID = None
        self.AllianceID = None
        self.CorporationName = None
        self.AllianceName = None
#Enter your UserID and API Keys here
CharacterID = 'XXXXXXXXXX'
#I'm going to store the characters in a dictionary.
#I use a dictionary to help me prevent duplicates.
Characters = {}
#Download the corporation contact list
apiURL = '' % (UserID, Key, CharacterID)
downloadedData = urllib.urlopen(apiURL)
parseContactAPI(downloadedData, Characters)
#Download your personal contact list
apiURL = '' % (UserID, Key, CharacterID)
downloadedData = urllib.urlopen(apiURL)
parseContactAPI(downloadedData, Characters)
#For each of the characters, get the character info so we can get the corporation
#I included a try in this case in case there's a failure to get one of the contacts.
#This way the whole script doesn't die, you just don't get that character's corporation.
for contactCharacterID, character in Characters.items():
        #Download the Character data
        apiURL = '' % (contactCharacterID)
        downloadedData = urllib.urlopen(apiURL)
        #Grab the corporation data
        XMLData = xml.dom.minidom.parse(downloadedData)
        dataNodes = XMLData.getElementsByTagName("result")
        for dataNode in dataNodes:
            corpElem = dataNode.getElementsByTagName("corporation")
            character.CorporationName = getText(corpElem[0])
        print 'skip %s' % character.CharacterName
#Connect to Outlook
Outlook = win32com.client.Dispatch("Outlook.Application")
#Go through the list of characters.
for CharacterID, Character in Characters.items():
    #Create a new Contact and save it
    NewContact = Outlook.CreateItem(win32com.client.constants.olContactItem)
    NewContact.FullName = Character.CharacterName
    NewContact.CompanyName = str(Character.CorporationName)

Last Updated on Wednesday, 06 July 2011 14:44  


0 #7 gas em osasco 2017-11-08 13:44
Tele Entrega Gás Rápida, Segura e também Garantida.
0 #6 vapor barrier 2017-09-13 20:53
I every time used to read piece of writing in news papers but now as I aam
a userr of web so frolm now I am using net for content,
thanks to web.
0 #5 Inge 2017-08-22 04:07
Now my weight appears to be in free fall.
0 #4 Benito 2017-07-23 18:25
Todo mundo os quartos dispõem de wi-fi e também avarandado privativa.
0 #3 viral news sites 2017-07-16 12:48
"YOU DON'T DO THAT TO ME!!!!!" Ang bagong sigaw ng bayan HAHAHA
0 #2 João Emanuel 2017-03-29 11:33
Esse currículo, conquanto, está bastante longe de incluir os êxitos, as derrotas, as
alegrias, as tristezas e as lutas inerentes à carreira da exclusivamente casal
portuguesa feminina de volei de praia que conseguiu apuramento para uns Jogos Olímpicos (Cristina Pereira/Mª José Schuller).
0 #1 web hosting and seo 2017-01-27 23:54
Wow that was unusual. I just wrdote an really long
comment but after I clicked submit my comment didn't
appear. Grrrr... well I'm not writing all that over again. Anyway, just wwanted to say superb

Add comment

Security code

Main Menu