google-api

Gmail API getting all Gmail Inbox messages limits to 500

99封情书 提交于 2020-01-04 14:07:08
问题 I am trying to get all the inbox messages in the Gmail API, but it's limiting to 500 per request. I would like to get all the messages, and the current messages in the repository is 1600+ but I am only able to get 500 on one request. $service = new Google_Service_Gmail($client); $user = 'me'; $params = array( 'labelIds' => 'INBOX', 'maxResults' => 20000 ); $last_date = mysqli_fetch_array($query); extract($last_date); $date = date_create($latest); $date->modify('-1 day'); $filter_date = date

Empty Google Drive Trash with Python

折月煮酒 提交于 2020-01-04 14:07:04
问题 I am trying to empty my google drive trash bin with the API, but with no luck. I have tried using the requests library, and the script runs through without errors, but the drive trash is not deleted. I have been able to get files via the API, but not delete or empty the trash. Seems I should be able to just send an http request, but this is proving far more difficult for me than it seems it should be. Any advice would be greatly appreciated. Here is what I have. I am not even getting a json

ImportError: cannot import name language in Google Cloud Language API

梦想的初衷 提交于 2020-01-04 13:46:08
问题 I am trying to use this sample code from the Google Natural Language API to get a sentiment score back. However, each time I run the code, I get an "ImportError: cannot import name language." error on the first line. I have pip installed the library, tried uninstalling and reinstalling, made the credentials on the console (the API is shown to be enabled) and looked at this tutorial too and completed those steps in the answer: Google sentiment analysis - ImportError: cannot import name

Special Characters in Google Calculator

你离开我真会死。 提交于 2020-01-04 12:14:53
问题 In a previous question I was told that Google passes UTF-8 encoded responses to queries. This solved a problem with non-breaking spaces (A0) being muddled after being passed by curl to my terminal. This was solved by piping the curl output to inconv and converting to UTF-8. However, even with this solution in place, I am still getting some strange output. Consider the following conversion of 2 m to feet: http://www.google.com/ig/calculator?hl=en&q=2%20m%20in%20feet This is the output I'm

Cannot exchange AccessToken from Google API inside Docker container

ぃ、小莉子 提交于 2020-01-04 06:32:38
问题 I have a web app written in Go, use oauth2 (package golang.org/x/oauth2 ) to sign user in by Google (follow this tutorial https://developers.google.com/identity/sign-in/web/server-side-flow). When I test app on local, it works fine but when I deploy app and run inside a Docker container (base on alpine:latest , run binary file), it has an error: Post https://accounts.google.com/o/oauth2/token: x509: certificate signed by unknown authority Here is my code to exchange the accessToken: ctx =

To check favicon using Google API

倾然丶 夕夏残阳落幕 提交于 2020-01-04 06:28:38
问题 How can we check favicon provided by Google API is the default globe? https://www.google.com/s2/u/0/favicons?domain=facebook.com returns the favicon of the facebook , where as https://www.google.com/s2/u/0/favicons?domain=test.com returns the globe as the favicon. How can we check if the favicon is default globe or not? 回答1: I made a function a while back what checks if the default globe icon is returned. function getFavicon($domain) { $data = file_get_contents('https://plus.google.com/_

GoogleWebAuthorizationBroker.AuthorizeAsync() hangs if browser closed

自闭症网瘾萝莉.ら 提交于 2020-01-04 05:58:26
问题 I'm writing a C# desktop app that can copy its output to a users Google Drive. However when I try an authorise access to Google with GoogleWebAuthorizationBroker.AuthorizeAsync() if the user closes the authentication page in the browser the method never returns! Even if I use a 30 sec cancellation token it never returns if the browser is closed. public bool Authorise() { _authorised = false; UserCredential credential = null; try { // here is where we Request the user to give us access, or use

Can I embed Google Street View into AFrame?

心不动则不痛 提交于 2020-01-04 05:43:20
问题 I'd like to recreate the Geoguesser street view game in VR. Although I understand the game is more complex than simply viewing Google Street View, I want to understand whether any work on the matter exists now. Even simply embedding Google Street View in VR would be helpful, even if it's not a solution in AFrame. Has anyone tried this before? Or can anyone speak to embedding Google Street View in VR? 回答1: It looks like you need to get the Street View panorama image in its full equirectangular

Whitelisting Service Account for Google Drive Document Access

允我心安 提交于 2020-01-04 05:27:13
问题 I have a service account created through the Google developer console specifically for API access to Google Drive to retrieve documents. However recently I have changed my G-suite Google Drive settings to have the security restriction that documents can only be shared outside of my organization to whitelisted domains rather than it being wide-open for sharing purposes. Prior to this security setting change everything was working fine having my service account access documents it has

Query multiple ID's on Google Analytics Javascript API

耗尽温柔 提交于 2020-01-04 04:57:22
问题 I'm using Google Analytic's API for javascript. I'm performing a query for the user's count of a data range, and passing the view ID to the query: gapi.client.analytics.data.ga.get({ 'ids': 'ga:XXXXXXXX', 'start-date': '2014-10-01', 'end-date': '2014-10-15', 'metrics': 'ga:users' }).execute(function (results) { if (results.rows && results.rows.length) console.log(results.rows[0][0]); }); However, since I'm dealing with the quotas of usage, and I needed to query for multiple views. Is there a