Package com.huangzhimin.contacts

Examples of com.huangzhimin.contacts.Contact


                    if (entry.hasName()) {
                        name = entry.getName().getFullName().getValue();
                    } else {
                        name = getUsername(address);
                    }
                    contacts.add(new Contact(name, address));
                }
            }
            return contacts;
        } catch (Exception e) {
            throw new ContactsException("gmail protocol has changed", e);
View Full Code Here


      login();
      List<Contact> contacts = new ArrayList<Contact>();
      BuddyList list = msn.getBuddyGroup().getAllowList();
      for (Iterator iter = list.iterator(); iter.hasNext();) {
        MsnFriend friend = (MsnFriend) iter.next();
        contacts.add(new Contact(new String(friend.getFriendlyName()
            .getBytes(), "UTF-8"), friend.getLoginName()));
      }
      logout();
      return contacts;
    } catch (Exception e) {
View Full Code Here

                                                            .getFirstChild().getNodeValue();
                                        }
          i++;
          String email = nodes.item(i).getFirstChild()
              .getFirstChild().getNodeValue();
          contacts.add(new Contact(username, email));
        }
      }
      return contacts;
    } catch (Exception e) {
      throw new ContactsException("126 protocol has changed", e);
View Full Code Here

         if (node.getAttributes().getNamedItem("class") != null &&
                                        node.getAttributes().getNamedItem("class").getNodeValue().equals("Addr_Td_Name")) {
          String username = node.getTextContent().trim();
          i++;
          String email = nodes.item(i).getTextContent().trim();
          contacts.add(new Contact(username, email));
        }
      }
      return contacts;
    } catch (Exception e) {
      throw new ContactsException("tom protocol has changed", e);
View Full Code Here

                            String email_text = node.getTextContent();
                            String email = email_text.substring(
                                    email_text.lastIndexOf("document.write(\"") + "document.write(\"".length(),
                                    email_text.lastIndexOf("\""));
                            i++;
                            contacts.add(new Contact(username, email));
                            empty = false;
                        }
                        if (node.getAttributes().getNamedItem("class").getNodeValue().equals("tx")) {
                            // another style for 189
                            String username_text = node.getTextContent();
                            String username = username_text.substring(
                                    username_text.lastIndexOf("document.write(\"") + "document.write(\"".length(),
                                    username_text.lastIndexOf("\""));
                            i += 2;
                            node = nodes.item(i);
                            String email_text = node.getTextContent();
                            String email = email_text.substring(
                                    email_text.lastIndexOf("document.write(\"") + "document.write(\"".length(),
                                    email_text.lastIndexOf("\""));
                            i++;
                            contacts.add(new Contact(username, email));
                            empty = false;
                        }
                    }
                }
                if (empty) break;
View Full Code Here

                    if (eventType == XmlPullParser.START_TAG && "displayName".equals(xpp.getName())) {
                        xpp.next();
                        username = xpp.getText();

                        Contact contact = new Contact(username, email);
                        contacts.add(contact);
                    }

                    xpp.next();
                    eventType = xpp.getEventType();
View Full Code Here

            JSONArray jsonContacts = jsonObj.getJSONArray("Contacts");
            for (int i = 0; i < jsonContacts.length(); i++) {
                JSONObject jsonContact = (JSONObject) jsonContacts.get(i);
                String username = jsonContact.getString("c");
                String email = jsonContact.getString("y");
                contacts.add(new Contact(username, email));
            }
            return contacts;
        } catch (Exception e) {
            throw new ContactsException("139 protocol has changed", e);
        }
View Full Code Here

                        username = nodes.item(i).getFirstChild().getFirstChild().getNodeValue();
                    }
                    i++;
                    String email = nodes.item(i).getFirstChild().getFirstChild().getNodeValue();
                    if (username != null) {
                        contacts.add(new Contact(username, email));
                    }
                }
            }
            return contacts;
        } catch (Exception e) {
View Full Code Here

                Node node = nodes.item(i);
                if (node.getAttributes().getNamedItem("class").getNodeValue().equals("Ibx_Td_addrName")) {
                    String username = node.getFirstChild().getTextContent().trim();
                    i++;
                    String email = nodes.item(i).getFirstChild().getTextContent().trim();
                    contacts.add(new Contact(username, email));
                }
            }
            return contacts;
        } catch (Exception e) {
            throw new ContactsException("163 protocol has changed", e);
View Full Code Here

      JSONArray jsonContacts = jsonData.getJSONArray("contact");
      List<Contact> contacts = new ArrayList<Contact>();
      for (int i = 0; i < jsonContacts.length(); i++) {
        jsonObj = jsonContacts.getJSONObject(i);
        if (jsonObj.has("name") && jsonObj.has("email")) {
          contacts.add(new Contact(jsonObj.getString("name")
              .replaceAll("&nbsp;", " "), jsonObj
              .getString("email")));
        }

      }
View Full Code Here

TOP

Related Classes of com.huangzhimin.contacts.Contact

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.