Importing yahoo, gmail & hotmail address book  using JSP

Hi,
i want to import the yahoo , gmail & hotmail contacts to my local MS access database. please give me the algorithm for importing contacts & if any one having the sample codes send it to me.. if any greatly appriciated.
Thanks in advance.
Regards
Chinna

are you having issues with the initial login, or is hotmail successfully taking your information, but failing to remember it when you access more of the site for address book information gathering?
If the first part is happening, you're probably not setting up your connection within a SSL environment correctly (I'm only guessing that's what hotmail uses, as I'm not a hotmail user). There's plenty of documentation on apache's jakarta site on how to do this/troubleshoot it.
If you're connecting, and it's not holding the information, then the cookie storing is not set up right. In that case, you may want to post a new topic more specifically relating to cookies (probably want to do it in the networking section of these forums, as it's far more pertinent there).
I wish I could help you more, but I am far more familiar with instantiating web connections via the UrlConnection class, and not with the Jakarta Commons libraries. :(

Similar Messages

  • Importing Hotmail Address Book using Jakarta HttpClient

    Hi,
    I am using jakarta httpclient to import hotmail address book. For that i am loading the login form first and then retrieving dynamic parameters and then posting the form for authentication of user.
    I am unable to authenticate user after posting the form , it redirects me to the login page.
    Can somebody help me to figure out what i am missing in my code??
    Following is the code i have written so far:
    (To run java one will need to enter hotmail emailId and password in the loginData)
    package msn.contacts.fetcher;
    import java.io.InputStream;
    import org.apache.commons.httpclient.Header;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.HttpStatus;
    import org.apache.commons.httpclient.NameValuePair;
    import org.apache.commons.httpclient.cookie.CookiePolicy;
    import org.apache.commons.httpclient.methods.GetMethod;
    import org.apache.commons.httpclient.methods.PostMethod;
    import org.cyberneko.html.parsers.DOMParser;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class MSNContactsFetcher {
         private String msnLoginUrl = "http://login.live.com/login.srf";
         public void login(){
              HttpClient httpClient = new HttpClient();
              httpClient.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
              int statusCode = -1;
              InputStream responseStream = null;
              DOMParser parser = null;
              InputSource source = null;
              try{
                   GetMethod loadForm = new GetMethod(msnLoginUrl);
                   loadForm.setFollowRedirects(true);
                   statusCode = httpClient.executeMethod(loadForm);
                   /*Header[] headers = loadForm.getResponseHeaders();
                   for(int i= 0;i<headers.length;i++){
                        System.out.println("Header name:: " + headers.getName() + " value::: " + headers[i].getValue());
                   System.out.println("Hotmail Status Code::: " + statusCode );          
                   if(statusCode == HttpStatus.SC_OK){
                        System.out.println("Hotmail Login Form Loaded Successfully");
                        System.out.println(loadForm.getResponseBodyAsString());
                        //System.exit(1);
                        String PPFT = null;
                        String PPSX = null;
                        String loginFormAction;
                        parser = new DOMParser();
                        responseStream = loadForm.getResponseBodyAsStream();
                        source = new InputSource(responseStream);
                        parser.parse(source);
                        Node form = parser.getDocument().getElementsByTagName("form").item(0);
                        NamedNodeMap attributes = form.getAttributes();
                        String formAction = attributes.getNamedItem("action").getNodeValue();
                        System.out.println("Form action ::: " + formAction);
                        NodeList inputElements = parser.getDocument().getElementsByTagName("input");
                        Node inputNode;
                        String name;
                        for(int i=0;i<inputElements.getLength();i++){
                             inputNode = inputElements.item(i);
                             name = inputNode.getAttributes().getNamedItem("name").getNodeValue();
                             //System.out.println(name + " " + inputNode.getAttributes().getNamedItem("value").getNodeValue() );
                             if(name.equals("PPFT")){
                                  PPFT = inputNode.getAttributes().getNamedItem("value").getNodeValue();
                             else if(name.equals("PPSX")){
                                  PPSX = inputNode.getAttributes().getNamedItem("value").getNodeValue();
                             else if(PPFT != null && PPSX!= null)
                                  break;
                             else
                                  continue;
                        System.out.println("PPFT::: " + PPFT + " PPSX::: " + PPSX );
                        NameValuePair[] loginData = {
                                  new NameValuePair("PPSX",PPSX),
                                  new NameValuePair("PwdPad","IfYouAreReadingThisYouHaveTooMuc"),
                                  new NameValuePair("login","<emailId>"),
                                  new NameValuePair("passwd","<password>"),
                                  new NameValuePair("LoginOptions","3"),                              
                                  new NameValuePair("PPFT",PPFT)                              
                        PostMethod postLoginForm = new PostMethod(formAction);                         
                        postLoginForm.setRequestBody(loginData);
                        httpClient.executeMethod(postLoginForm);
                        statusCode = postLoginForm.getStatusCode();
                        System.out.println("Status Code::: " + statusCode);
                        String responseString = postLoginForm.getResponseBodyAsString();
                        System.out.println("Response string:: " + responseString);
              }catch(Exception ex){
                   System.out.println("Exception Occurred -->> " + ex.getMessage());
                   ex.printStackTrace();
         public static void main(String[] args) {
              System.getProperties().setProperty("httpclient.useragent", " Mozilla/5.0 (Win98; I;Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4");
              System.setProperty("org.apache.commons.logging.Log","org.apache.commons.logging.impl.SimpleLog");
              System.setProperty("org.apache.commons.logging.simplelog.showdatetime","true");
              System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header","debug");
              MSNContactsFetcher msn = new MSNContactsFetcher();
              msn.login();

    are you having issues with the initial login, or is hotmail successfully taking your information, but failing to remember it when you access more of the site for address book information gathering?
    If the first part is happening, you're probably not setting up your connection within a SSL environment correctly (I'm only guessing that's what hotmail uses, as I'm not a hotmail user). There's plenty of documentation on apache's jakarta site on how to do this/troubleshoot it.
    If you're connecting, and it's not holding the information, then the cookie storing is not set up right. In that case, you may want to post a new topic more specifically relating to cookies (probably want to do it in the networking section of these forums, as it's far more pertinent there).
    I wish I could help you more, but I am far more familiar with instantiating web connections via the UrlConnection class, and not with the Jakarta Commons libraries. :(

  • Exporting hotmail contacts to Address Book using numbers

    Hi, I've been reading some other topics on how to export your contacts to address book. Though these were helpful, I do not have microsoft excel. Is it possible to get my hotmail contacts to my address book using numbers or do I need excel.

    Hello,
    If you go into Entourage's preferences, you'll also find the option to "Synchronize" with Address book.
    The option is under the Entourage menu
    Choose Preferences
    Then, go to General, and choose Sync Services
    The option you need should be the first option in the list on the Sync Services screen.
    It should have a box to check located next to: "Synchronize Contacts with Address Book and .Mac".
    Give that a shot.
    I hope this helps.
    Let us know if you have other questions.
    P.S., if you'd like, go ahead and click the "Helpful" or "Solved" buttons on any of the posts / replies above if you feel they were helpful or adequately answered your question.

  • The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    Thanks, I appreciate the help.  I think this is one of the problems Apple is creating by changing the OS so often. I had fomer colleagues at [a major aerospace contractor] who told me that so many original files were ultimately lost because of the deadly change in the "Save As" operation that they are now afraid of every OS update. Apple has badly damaged their support base with that very prominent company (they won't update now until they've fully examined and understand changes in the pre-conditioned nature of OS computer functions), and they are a whole lot less enthaled with Mac-related equipment/software. Can't blame them, I too used orginal files that way (as easy-to-use templates), and lost some important files before I realized what was happening (to late to revert). Companies should not have to retrain employees each time an OS gets an update, it's can be very expensive several different ways. They learned a painful lesson with that one. And because I'm now retired and don't use multiple devices, I need iCloud like I need a hole in the head... but I'm told there's no way to keep Apple out of my computer. Fortunately, because of major problems when initially installing Mountain Lion, one hold-over of the hardware/software damage I experienced was that iCloud can no longer access my computer even though everything else is working fine again. That was the only "good luck" I had as a result of that expensive nightmare.

  • Java Code to scrape a hotmail address book

    Hi all... Can anyone help with trying to scrape a hotmail address book based on the user-id and password given with the help of a java program.. I tried using HTML Unit to do this but the process seems too tedious.. and cant really figure out the hidden variables n stuff in the hotmail website.
    Please help me out.... !! thanx !!

    Yes i did try that though... But it didnt work... I've made use of HTMLUnit to do this .. I've extracted all the hidden variables and tried to re-post them.. But still wasnt able to sign in to Hotmail through Java.. Here's the code that i tried...
    String PwdPad="IfYouAreReadingThisYouHaveTooMuchFreeTime";
              final WebClient webClient=new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0);
              webClient.setRedirectEnabled(true);          
              //Get the hotmail page
              final URL url=new URL("http://www.hotmail.com");
              HtmlPage homePage=null;
              homePage=(HtmlPage)webClient.getPage(url);
              Search(homePage);
              final HtmlForm form=homePage.getFormByName("f1");
              final HtmlSubmitInput button=(HtmlSubmitInput) form.getInputByName("SI");
              //Settting the user name and password
              final HtmlTextInput text1=(HtmlTextInput) form.getInputByName("login");
              final HtmlPasswordInput text2=(HtmlPasswordInput) form.getInputByName("passwd");
              //Hidden Variables
              final HtmlHiddenInput ppsx=(HtmlHiddenInput) form.getInputByName("PPSX");
              final HtmlHiddenInput pwdpad=(HtmlHiddenInput) form.getInputByName("PwdPad");
              final HtmlHiddenInput ppft=(HtmlHiddenInput) form.getInputByName("PPFT");
              System.out.println("The Action is:: "+form.getActionAttribute());
              //Re-posting the Entries (PPSX,Login,Password,PwdPad,PPFT)
              int len;
              len=PwdPad.length()-pass.length();
              PwdPad = PwdPad.substring(0, len);
              text1.setValueAttribute(email);
              text2.setValueAttribute(pass);
              //ppsx.setValueAttribute( ppsx.getValueAttribute());
              //pwdpad.setValueAttribute( PwdPad);
              //ppft.setValueAttribute( ppft.getValueAttribute());
              System.out.println("user:"+text1.getValueAttribute() + " password:" + pass+" ppsx:"+ppsx.getValueAttribute()+" PwdPad:"+pwdpad.getValueAttribute()+" ppft:"+ppft.getValueAttribute() + " login opts:");
              //URL postURL = new URL ("https://login.live.com/ppsecure/post.srf?id=2&bk=1185180903") ;
              URL postURL = new URL (form.getActionAttribute()) ;
              WebRequestSettings webRequestSettings = new WebRequestSettings(postURL,SubmitMethod.POST);
              String requestBody = "PPSX="+ ppsx.getValueAttribute() +"&PwdPad="+PwdPad+"&login=email%40hotmail.com&passwd="+pass+
                        "&LoginOptions=2&PPFT=" + ppft.getValueAttribute() ;
              webRequestSettings.setRequestBody(requestBody);
              //HtmlPage page= ( HtmlPage ) webClient.getPage(webRequestSettings);
              HtmlPage page=(HtmlPage)button.click();
              System.out.println(page.asText());

  • Lion Server: How do I import into the central address book?

    Hello
    I could successfully import addresses into the local address book of my Mac Mini (using the import function of the address book application).
    However, I want the addresses to be in the central, shared address book of the Lion Server. I can't find a way to import there.
    Does anyone have an idea?
    Thanks! Martin

    Never mind, I figured it out: Open the local addresses, select all, drag/drop to the desktop. Then open the server address book and drag/drop from the desktop.

  • Can i download my Hotmail address book onto my phone?

    Or do i have to enter this manually for each contact?
    I'd really appreciate it if you could help.
    Thanks,

    I don't do Hotmail, but if you can determin how to download or export your hotmail address book to your PC (like an ASCII, CSV or Excel file), then you can import that data into Outlook to sync to your BlackBerry.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Importing text file to address book?

    I created a text tab-delimited file for import. From within Address Book, ran "Import". Matched up field names. All looked good. When I clicked on "OK" basically very little happened. After a few seconds the blue OK button became clear but nothing else. I advanced another record, clicked OK on it and same few seconds then nothing. I expected all the records to be imported.
    In any case, tried this individually with a few records, then checked the Address Book and none of the info was in there.
    Is this some kind of bug? I don't see that I did anything that was wrong with the import.
    Advice appreciated.
    Richard

    Not sure if this helps, but ...
    I made a quick text file to see if I could duplicate your problem. I put in three lines, the first with field names (First, Last, Work) and the other two with corresponding data. The values within each line were tab separated. When I ran AB's import I had to match up the third field to correspond with email (work). I flicked through the displayed records (all two of them!!) and they displayed as contact cards. I then clicked OK, and unlike your description, the import dialogue immediately vanished. The records were correctly imported.
    When you look at the records in the import dialog do they all display correctly?
    Could it be a 10.4.3 issue?
    After attempting to do the import, has your contact count gone up?
    What happens if you select the "last import" group?

  • Export Address Book using CSV file to Verizon Webmail

    I need to export the contents of my address book using a CSV file format which is compatible with Verizon Webmail.
    Verizon Webmail will not acknowledge any other format other than CSV and reject my attempts to use Mac sys tem formats.
    Help.... Chan

    I need to export the contents of my address book using a CSV file format which is compatible with Verizon Webmail.
    Verizon Webmail will not acknowledge any other format other than CSV and reject my attempts to use Mac sys tem formats.
    Help.... Chan

  • Hotmail address book no longer works

    My hotmail address book no longer works. When I press "To" in the address bar, nothing comes up. If I press "reply" to respond to an email then again, nothing happens. I have to copy and paste the address. The only way I can find out an address is to go into the search box, bring up an old email and paste the address from it. This problem happened a while ago and seems to be after one of the automatic Firefox updates. Please can you advise? Thanks

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Add or edit address book using Desktop Manager

    Is there any way that I can add or edit my address book using the Desktop software? I would like to input email addresses and other information into my address book on my blackberry without having to type everything in on the blackberry. I was hoping there would be a way to do that on my PC and have it sync to my phone.

    he following steps will help you to configure synchronization -
    Connect your device using Desktop Manager and click on Synchronization
    From the menu on the left click Synchronization under Configuration
    Again click Synchronization button on the right which will give you option to Select Device Application that you want to synchronize
    Put the check mark and you'll get a prompt to Select Desktop Application
    Highlight the application name and click next button
    Under Synchronization Option you get Direction of Synchronization
    Check the radio button with Two way sync 
    Note: above mentioned steps are explained as per Desltop Manager 4.5
    Example: Synchronize addressbook -
    Connect you HH with your desktop Manager in your PC. If you device is set to wireless sync then you need to turn off wireless synchronization. To do so go to Address Book -> click Menu -> Options -> Wireless Synchronization: No -> click Menu and Save the changes.
    Click on the Synchronize button on Desktop Manager -> Click on Configuration Tab then click on Configure Synchronization -> Click on Choose under Address Book (on the right side of the pop up window) -> Click on you organizer apps (like, MS outlook, Lotus notes etc) -> Select desired apps -> select Synchronization radio button and click OK twice go back to Synchronize tab ->click on Synchronize Now.
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Importing Windows Outlook Express address book

    Hello
    I have been trying to import an Outlook Express address book (which is stored on a DVD) to MS Entourage with not much luck
    I can't seem to find an 'option' to import an external address book.
    The only options available seem to be to import Entourage docs/archives etc.
    Can anyone help?

    I've been looking into this myself and there are a number of possibilities. You can't just import an address book but importing all your contacts can be done. Search discussions here for the topic (the Mail and Address Book forum has stuff on getting contacts out of Outlook) and also Google the web, there are several threads elsewhere. There are even shareware utilities to help.
    Also look under Mac 101: Shifting From PC in the Support section here. Apple has a little bit to say on it, although not terribly helpful to me.

  • Accessing Microsoft Outlook address Book using java

    Hi All,
    Can anyone tell me how can i access outlook address book using java or java script
    Thanks in anticipation,
    Reagrds,
    Preeti Gupta

    www.microsoft.com/java/sdk/default.htm
    support.microsoft.com/support/kb/articles/Q168/9/42.asp
    Hope this helps you.
    Rajesh

  • Create Offline Address Book using powershell - PublicFolderDistributionEnabled not found

    We are using the following commands to create a new Offline Address book using powershell. The command New-OfflineAddressBook runs successfully and creates an Offline Address Book. However when we try to set the value of PublicFolderDistributionEnabled property
    using Set-OfflineAddressBook we get the following exception
    Remote Exception: A parameter cannot be found that matches parameter name 'PublicFolderDistributionEnabled'
                try
                    using (Runspace runSpace = OpenRunspace())
                        // Create offline address book command
                        var command = new Command("New-OfflineAddressBook");
                        command.Parameters.Add("Name", name);
                        command.Parameters.Add("AddressLists", addressListName);
                        command.Parameters.Add("VirtualDirectories", OABServer);
                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command)) == false)
                            return false;
                        // Set offline address book command
                        var command1 = new Command("Set-OfflineAddressBook");
                        command1.Parameters.Add("Identity", name);
                        command1.Parameters.Add("PublicFolderDistributionEnabled", publicFolderEnabled);
                        command1.Parameters.Add("Confirm", new SwitchParameter(false));
                        // Execute command
                        if ((res = ExecuteShellCommand(runSpace, command1)) == false)
                            DeleteOfflineAddressBook(name);
                            return false;
                catch (Exception ex)
                    DeleteOfflineAddressBook(name);
                    throw;

    If your Exchange version is 2013 it supports only the web distribution method.
    Please follow this to create OAB in Exchange2013 
    http://blogs.technet.com/b/exchange/archive/2013/01/14/managing-oab-in-exchange-server-2013.aspx
    Please check this for the details of OAB in Exchange2013
    http://blogs.technet.com/b/exchange/archive/2012/10/26/oab-in-exchange-server-2013.aspx
    If it Exchange2010 please check
    this
    Thanks, MAS
    Please mark as helpful if you find my comment helpful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • HT201320 I am having trouble with password. Forgetting password,as I have many mail IDs like yahoo,gmail,hotmail,apple, I cloud etc.,thus confusing about password and restating through procedures. The altered password is not accepted I Safari

    I am having trouble with password. Forgetting password,as I have many mail IDs like yahoo,gmail,hotmail,apple, I cloud etc.,thus confusing about password and restating through procedures. The altered password is not accepted I Safari. When I want to open my mail but window appears as incorrect password though the mail appears on the left. however whe I go to my mail separately opening my mail, without mail icon in my pad.

    I'm having the same problem, what did you do?

Maybe you are looking for