Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
leentu
leentu's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Gmail inbox feed XML parsing
[4 Replies]
10-Jul-2012 12:49 AM
Forum:
Contributed Library Questions
Hi!
I'm trying to write a parser that would take information from the Gmail inbox feed.
The problem that i have, I think, is associated with authentication and SSL-encryption.
I tried to get information using XML queries (from Daniel Shiffman's SimpleML library), and using loadStrings() function. The result is the same — if the URL is
https://mail.google.com/mail/feed/atom
— I get a 401 error (which is expected), but if i enter
https://myaccountname@gmail.com:mypassword@mail.google.com/mail/feed/atom
(which works correctly when i type it directly into browser URL bar) i get
java.net.MalformedURLException: For input string: "password@mail.google.com"
Something's wrong with the URL:
https://account@gmail.com:password@mail.google.com/mail/feed/atom
Here is the code i used:
import simpleML.*;
XMLRequest xmlRequest;
String proto = "https://";
String acc = "myaccounthere@gmail.com";
String pass = "mypasswordhere";
String server = "mail.google.com";
String path = "/mail/feed/atom";
void setup() {
size(200, 200);
// Creating and starting the request
xmlRequest = new XMLRequest(this, proto + acc + ":" + pass + "@" + server + path);
xmlRequest.makeRequest();
}
void draw() {
background(0);
}
// When the request is complete
void netEvent(XMLRequest ml) {
// Retrieving an array of all XML elements inside "<fullcount>" tags
String[] counts = ml.getElementArray("fullcount");
for (int i = 0; i < counts.length; i++) {
println(counts[i]);
}
}
Сode works fine for everything except Gmail :<
I'll be very grateful if someone can help with some idea.
«Prev
Next »
Moderate user : leentu
Forum