Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15660 > unrolled thread

Getting error while getting Google plus posts

Started byGeorge <vijuitech@gmail.com>
First post2012-06-27 07:32 -0700
Last post2012-06-28 12:53 -0700
Articles 6 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Getting error while getting Google plus posts George <vijuitech@gmail.com> - 2012-06-27 07:32 -0700
    Re: Getting error while getting Google plus posts markspace <-@.> - 2012-06-27 09:03 -0700
      Re: Getting error while getting Google plus posts George <vijuitech@gmail.com> - 2012-06-27 09:21 -0700
      Re: Getting error while getting Google plus posts George <vijuitech@gmail.com> - 2012-06-27 09:19 -0700
        Re: Getting error while getting Google plus posts Lew <lewbloch@gmail.com> - 2012-06-27 11:43 -0700
    Re: Getting error while getting Google plus posts Roedy Green <see_website@mindprod.com.invalid> - 2012-06-28 12:53 -0700

#15660 — Getting error while getting Google plus posts

FromGeorge <vijuitech@gmail.com>
Date2012-06-27 07:32 -0700
SubjectGetting error while getting Google plus posts
Message-ID<9c55586b-7995-47af-a4b0-44acacf587c7@q5g2000pba.googlegroups.com>
Hi,
     I am using the following code to get the Google Plus posts,


import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.plus.Plus;
import com.google.api.services.plus.PlusScopes;
import com.google.api.services.plus.model.Activity;
import com.google.common.base.Preconditions;
import com.google.common.io.Files;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.security.PrivateKey;
import java.text.*;
import java.util.Properties;

import redegg.redcals.update.View;

public class Test {

  /** E-mail address of the service account. */
  private static final String SERVICE_ACCOUNT_EMAIL = "801283043278-
ek42r1e5ulsvdremass1huh7rtcq16lp.apps.googleusercontent.com";

  /** Global instance of the HTTP transport. */
  private static final HttpTransport HTTP_TRANSPORT = new
NetHttpTransport();

  /** Global instance of the JSON factory. */
  private static final JsonFactory JSON_FACTORY = new
JacksonFactory();

  private static Plus plus;

  public static void main(String[] args) {
    try {
      try {

      GoogleCredential credential = new GoogleCredential.Builder()
              .setClientSecrets("801283043278-
ek42r1e5ulsvdremass1huh7rtcq16lp.apps.googleusercontent.com",
"1BgzhV28ie_EXF7AD4Xf3y75")
        .build();
        plus = new Plus.Builder(HTTP_TRANSPORT,JSON_FACTORY,
credential).build();

         getActivity();
	        // success!
	        return;
	      } catch (IOException e) {
	        System.err.println(e.getMessage());

	      }
	    } catch (Throwable t) {
	      t.printStackTrace();
	    }
	    System.exit(1);
  }

   /** Get an activity for which we already know the ID. */
    	private static void getActivity() throws IOException {
      String activityId = "z12stbfxcpmkuthac04ci3gjvoywglkwx0k";
      Activity activity = plus.activities().get(activityId).execute();

     System.out.println("id: " + activity.getId());
     System.out.println("url: " + activity.getUrl());
     System.out.println("content: " +
activity.getObject().getContent());
    }
}

While running this code  I am getting  the following error,


403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "Daily Limit Exceeded. Please sign up",
    "reason" : "dailyLimitExceededUnreg",
    "extendedHelp" : "https://code.google.com/apis/console"
  } ],
  "message" : "Daily Limit Exceeded. Please sign up"
}

Could any one please help me to fix this error.

Thanks in Advance!

[toc] | [next] | [standalone]


#15662

Frommarkspace <-@.>
Date2012-06-27 09:03 -0700
Message-ID<jsfat8$eps$1@dont-email.me>
In reply to#15660
On 6/27/2012 7:32 AM, George wrote:

>      "message" : "Daily Limit Exceeded. Please sign up",


Here is the problem, and the solution.  My, that was easy.

[toc] | [prev] | [next] | [standalone]


#15664

FromGeorge <vijuitech@gmail.com>
Date2012-06-27 09:21 -0700
Message-ID<567b8e39-00ec-4ea7-9506-cc17b13e2aa4@2g2000pbv.googlegroups.com>
In reply to#15662
On Jun 27, 9:03 pm, markspace <-@.> wrote:
> On 6/27/2012 7:32 AM, George wrote:
>
> >      "message" : "Daily Limit Exceeded. Please sign up",
>
> Here is the problem, and the solution.  My, that was easy.


Could you please tell me what the solution is?

[toc] | [prev] | [next] | [standalone]


#15665

FromGeorge <vijuitech@gmail.com>
Date2012-06-27 09:19 -0700
Message-ID<9a9dba0b-9a4d-4787-9723-efc7027b7cb1@nl1g2000pbc.googlegroups.com>
In reply to#15662
On Jun 27, 9:03 pm, markspace <-@.> wrote:
> On 6/27/2012 7:32 AM, George wrote:
>
> >      "message" : "Daily Limit Exceeded. Please sign up",
>
> Here is the problem, and the solution.  My, that was easy.

can ypu please tell me what the solution is?

[toc] | [prev] | [next] | [standalone]


#15673

FromLew <lewbloch@gmail.com>
Date2012-06-27 11:43 -0700
Message-ID<c14dfc18-97b3-42fe-8cf0-667074a395a4@googlegroups.com>
In reply to#15665
George wrote:
> markspace <-@.> wrote:
>> George wrote:
>>
>>>      "message" : "Daily Limit Exceeded. Please sign up",
>>
>> Here is the problem, and the solution.  My, that was easy.
> 
> can ypu please tell me what the solution is?

"Daily Limit Exceeded. Please sign up"

It's not very polite to ignore the answer given and demand it again.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15731

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-06-28 12:53 -0700
Message-ID<ccdpu7dv3lijh4bjajdticomked4davaro@4ax.com>
In reply to#15660
On Wed, 27 Jun 2012 07:32:13 -0700 (PDT), George <vijuitech@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>  "message" : "Daily Limit Exceeded. Please sign up"

It looks as though you must register with Google and get some sort of
account and password that you must use it to receive these messages. I
looks as if you left it out, got it wrong or screwed up the format.
Apparently it lets you experiment a little without signing up, or
maybe the limit is 0 and this is misleading error message.

I suggest googling for code that other people have written to do this.
That is how I cracked a similar problem with an Amazon API with
monumentally incompetent documentation.

Use the names of Google-specific classes to help you find it.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
When you get stuck trying to solve a computer program: 
1. Go into the kitchen and make coffee.
2. If that fails, go for a walk.
3. If that fails, take a nap.
Why? To avoid being swamped with details, to see the big picture,
to allow in some random noise to kick you out of your thinking rut.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web