I want to read the mail headers of all my unread mails from my gmail
account.
I knew that gmail allows reading the mail headers of an account using
RSS and Atom Aggregators.
I want to read the same using java.
means ,i need to get the mail headers from any one of the freeware
aggregators (open source )?
or there is any way to produce the input in atom format to get the mail
headers by  directly hitting the gmail server ,
java mail will help on this ?
Will Gdata help for the same .


https://gmailusername:[EMAIL PROTECTED]/gmail/feed/atom/
the above is the url for the aggregators to get the  mail headers for
gmail account
if u directly give the url in the browser ,it ask for the user name and
password and display the following xml in the browser .
.______________________________________________________________________________________

     <feed version="0.3">
<title>Gmail - Inbox for [EMAIL PROTECTED]</title>
<tagline>New messages in your Gmail Inbox</tagline>
<fullcount>2</fullcount>
<link rel="alternate" href="http://mail.google.com/mail";
type="text/html"/>
<modified>2006-09-13T11:18:20Z</modified>
&#8722;
     <entry>
<title>Google Alert - IT</title>
&#8722;
     <summary>
Google Alert for: IT Kicking it back into gear Boston Globe - United
States ... MIAA Division 1 &hellip;
</summary>
<link rel="alternate"
href="http://mail.google.com/mail?account_id=vsubram2%40gmail.com&message_id=10da6e10d213e511&view=conv&extsrc=atom";
type="text/html"/>
<modified>2006-09-13T11:12:49Z</modified>
<issued>2006-09-13T11:12:49Z</issued>
<id>tag:gmail.google.com,2004:1214404068052821265</id>
&#8722;
     <author>
<name>Google Alerts</name>
<email>[EMAIL PROTECTED]</email>
</author>
</entry>
&#8722;
     <entry>
<title>Saying 'I Love You'</title>
&#8722;
     <summary>
Saying &#39;I Love You&#39;.............in your own special way. This
guy, a Shanghai university &hellip;
</summary>
<link rel="alternate"
href="http://mail.google.com/mail?account_id=vsubram2%40gmail.com&message_id=10da6c5f65a4d2e9&view=conv&extsrc=atom";
type="text/html"/>
<modified>2006-09-13T10:43:14Z</modified>
<issued>2006-09-13T10:43:14Z</issued>
<id>tag:gmail.google.com,2004:1214402206512763625</id>
&#8722;
     <author>
<name>dipej.neelapareddy</name>
<email>[EMAIL PROTECTED]</email>
</author>
</entry>
</feed>
___________________________________________________________________________________________
my concern is ,i am trying to hit the same url
https://gmailusername:[EMAIL PROTECTED]/gmail/feed/atom/
thru java url,urlconnection but i dont know how to give the password
and username thru code.

my another question on the above is ,how the aggregator gives the
username and password and why it is required since those are already
incorporated in the user name and the password.


coming to this http://code.google.com/apis/gdatal ,it is for blogger
similarly one more api is provided by gmail for it calender google
service,is there any api's provided for google's gmail service,that i
want to get the mail headers of my unread mails alone and not any other
detail.

I tried the following thru gdata api

URL feedUrlForMail = new URL("
https://gmailusername:[EMAIL PROTECTED]/gmail/feed/atom/");

                        String mailServiceName="mail";

                        GoogleService myService = new 
GoogleService(mailServiceName,
                                        "exampleCo-exampleApp-1");
                        myService.setUserCredentials("gmailusername", 
"password");
                        Feed myFeed = myService.getFeed(feedUrlForMail, 
Feed.class);


I am getting the following:

The url to be posted [added in the GDATA
Source]https://www.google.com/accounts/ClientLogin
The content of the URL Posted
service=mail&Passwd=password&Email=gmailusername&accountType=HOSTED_OR_GOOGLE&source=exampleCo-exampleApp-1
In Http_Ok
Got the input stream after launching the url with the parameters [added
in GDATA]
com.google.gdata.util.AuthenticationException: Unauthorized
        at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:480)
        at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:458)
        at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:452)
        at
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:430)
        at
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:441)
        at com.google.gdata.client.Service.getFeed(Service.java:458)Service
Exception while getting the feed

        at
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:677)
        at com.google.gdata.client.Service.getFeed(Service.java:497)
        at Headers.readCalendar(Headers.java:33)
        at Headers.main(Headers.java:58)
Exception in thread "main" java.lang.NullPointerException
        at Headers.main(Headers.java:59)

Please help on this .


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data API" group.
To post to this group, send email to google-help-dataapi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-help-dataapi
-~----------~----~----~----~------~----~------~--~---

Reply via email to