Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 21st, 2006, 07:38 AM
Authorized User
 
Join Date: Sep 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get contact addresses from websites(yahoo)

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/test...est/index.aspx

How can i acheive this...

 
Old September 21st, 2006, 09:13 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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.
 
Old September 28th, 2006, 07:38 AM
Authorized User
 
Join Date: Sep 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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


 
Old September 28th, 2006, 07:50 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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.
 
Old October 3rd, 2006, 01:08 AM
Authorized User
 
Join Date: Sep 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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






Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate multiple email addresses mat41 Javascript 1 August 29th, 2007 12:45 AM
Validate multiple email addresses... mat41 Javascript 5 March 16th, 2006 12:17 AM
SQL query for email addresses clearsky SQL Language 1 October 7th, 2005 10:15 PM
Network printer addresses interrupt Javascript How-To 6 September 2nd, 2004 10:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.