|
Subject:
|
How to get contact addresses from websites(yahoo)
|
|
Posted By:
|
suryasimha
|
Post Date:
|
9/21/2006 7:38:18 AM
|
hi all,
There is a website which maintains friends n colleagues informaton. I want to develop API using webservices that must must provide.... 1. given a websites user’s account id and password, collect all the contacts of the member and download all the contacts’ profile details. There no local database to store the contact information..i've get the info from the website(frommycontacts sections) and segreagate that info and to store in a database.
it should be just like this
http://www.contactsimporter.net/testimport/test/index.aspx
How can i acheive this...
|
|
Reply By:
|
dparsons
|
Reply Date:
|
9/21/2006 9:13:36 AM
|
IMHO, i am not going to freely enter my email address and password into some online xyz application, regardless if it says that my password isnt being stored on the server i am still providing that information.
As far as writing your own API, go to the various providers and grab their tech documents on how to interact with their services.
--Stole this from a moderator
I will only tell you how to do it, not do it for you. Unless, of course, you want to hire me to do work for you.
|
|
Reply By:
|
suryasimha
|
Reply Date:
|
9/28/2006 7:38:24 AM
|
Hi dparsons,
I get the contacts page as html content by this code.Now..i need only selected content ie only contacts (which r in div/table tag) not a complete page.
private void Button1_Click(object sender, System.EventArgs e) {
HttpWebRequest webRequest = WebRequest.Create(LOGIN_URL) as HttpWebRequest; StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseS tream()); string responseData = responseReader.ReadToEnd(); responseReader.Close(); string uid = txtuid.Text.Trim(); string pwd=txtpwd.Text.Trim(); // extract the viewstate value and build out POST data // string viewState = ExtractViewState(responseData); string postData = String.Format("session_key={0}&session_password={1}&session_login=Submit",uid, pwd);
// have a cookie container ready to receive the forms auth cookie CookieContainer cookies = new CookieContainer();
// now post to the login form webRequest = WebRequest.Create(LOGIN_URL) as HttpWebRequest; webRequest.Method = "POST"; webRequest.ContentType = "application/x-www-form-urlencoded"; webRequest.CookieContainer = cookies;
// write the form values into the request message StreamWriter requestWriter = new StreamWriter(webRequest.GetRequestStream()); requestWriter.Write(postData); requestWriter.Close();
// we don't need the contents of the response, just the cookie it issues webRequest.GetResponse().Close();
// now we can send out cookie along with a request for the protected page webRequest = WebRequest.Create(url of contacts page) as HttpWebRequest; webRequest.CookieContainer = cookies; responseReader = new StreamReader(webRequest.GetResponse().GetResponseS tream());
// and read the response responseData = responseReader.ReadToEnd(); responseReader.Close(); Response.Write(responseData);
}
pls suggest me to complete this
Surya
|
|
Reply By:
|
dparsons
|
Reply Date:
|
9/28/2006 7:50:03 AM
|
You are going to have to parse your Response streams to extract the data you want.
--Stole this from a moderator
I will only tell you how to do it, not do it for you. Unless, of course, you want to hire me to do work for you.
|
|
Reply By:
|
suryasimha
|
Reply Date:
|
10/3/2006 1:08:51 AM
|
dparson,
i parsed the webpage and i got the data avialable in table tag if webpage ...but i want to filter this data..i don't want images and junk data in my response stream.. is there any way to filter response data which is assigned to string variable?..
Surya
|