Loading...
Logo
Processing Forum
leentu's Profile
1 Posts
1 Responses
0 Followers

Activity Trend

Last 30 days

Loading Chart...

Show:
Private Message
    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

    1. java.net.MalformedURLException: For input string: "password@mail.google.com"
    2. Something's wrong with the URL:  https://account@gmail.com:password@mail.google.com/mail/feed/atom

    Here is the code i used:
    1. import simpleML.*;

    2. XMLRequest xmlRequest;

    3. String proto = "https://";
    4. String acc = "myaccounthere@gmail.com";
    5. String pass = "mypasswordhere";
    6. String server = "mail.google.com";
    7. String path = "/mail/feed/atom";

    8. void setup() {
    9.   size(200, 200);
    10.   // Creating and starting the request
    11.   xmlRequest = new XMLRequest(this, proto +  acc + ":" + pass + "@" + server  +  path);
    12.   xmlRequest.makeRequest();
    13. }

    14. void draw() {
    15.   background(0);
    16. }

    17. // When the request is complete
    18. void netEvent(XMLRequest ml) {
    19.   // Retrieving an array of all XML elements inside "<fullcount>" tags
    20.   String[] counts = ml.getElementArray("fullcount");
    21.   for (int i = 0; i < counts.length; i++) {
    22.     println(counts[i]);
    23.   }
    24. }
    Сode works fine for everything except Gmail :<
    I'll be very grateful if someone can help with some idea.