Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 294775317
  • Loading branch information
Shopping Developer Relations authored and Brothman committed Feb 10, 2023
1 parent 99a3af5 commit e9514ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 98 deletions.
16 changes: 1 addition & 15 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>3.8.0</version>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<source>7</source>
<target>7</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.1.2</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
23 changes: 22 additions & 1 deletion php/ContentSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,29 @@ public function getHome() {
return rtrim($home, '\\/');
}

private function getToken(Google_Client $client) {
$client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');
$client->setScopes('https://www.googleapis.com/auth/content');
$client->setAccessType('offline'); // So that we get a refresh token

printf("Visit the following URL and log in:\n\n\t%s\n\n",
$client->createAuthUrl());
print ('Then type the resulting code here: ');
$code = trim(fgets(STDIN));
$client->authenticate($code);

return $client->getAccessToken();
}

protected function cacheToken(Google_Client $client) {
throw new Exception('This example currently only supports the service account flow..');
print (str_repeat('*', 40) . "\n");
print ("Your token was missing or invalid, fetching a new one\n");
$token = $this->getToken($client);
$tokenFile = join(DIRECTORY_SEPARATOR,
[$this->configDir, self::OAUTH_TOKEN_FILE_NAME]);
file_put_contents($tokenFile, json_encode($token, JSON_PRETTY_PRINT));
printf("Token saved to %s\n", $tokenFile);
print (str_repeat('*', 40) . "\n");
}

/**
Expand Down
82 changes: 0 additions & 82 deletions python/shopping/content/reports/get_product_performance.py

This file was deleted.

0 comments on commit e9514ab

Please sign in to comment.