Statistics on number of Google Spreadsheets using the new Google Drive User Metrics - spreadsheet

Google Admin SDK used to have the "Google Docs" User Metrics for reporting. With it we were able to fetch the property "docs:num_spreadsheets" to get the number of spreadsheets owned by the each user. The Google docs metrics are now being deprecated, replaced by Google Drive metrics. However I don't any way to get the number of spreadsheets of a user. I can get the number of spreadsheets created by a user during a certain period (which period exactly, I couldn't figure out) but not the total number of Spreadsheets owned by them.
In this page it's written that drive:num_owned_google_spreadsheets_delta replaces the deprecated docs:num_spreadsheets but these are not the same metrics.
Any idea on how to address that?
Thanks a lot,
Rafael

As an alternative to the Admin SDK metrics, using the Drive API and generating the metrics user by user may be an option for you.
If so, in summary the pseudocode is: using a Service Account to impersonate each user and get an OAuth2 token , call the Drive REST API files.list method with a query (&q=...) of all files of mimetype of application/vnd.google-apps.spreadsheet and the user's email in owners. The length of the result set's files.files array is the count of the files (the metric) you want.

Related

How to retrieve old tweets (beyond the most recent 3,200 tweets) from a specific user account on Twitter?

I have access to the Academic Research API. I am trying to retrieve old tweets from political candidates’ accounts during certain election campaigns (i.e., I would ideally specify begin and end dates). The timeline endpoint allows me to retrieve only the last 3,200 tweets of each of these accounts; but this falls short, since I cannot get any tweets from the desired election campaign period because it is too old in the timeline. I would ideally like to retrieve 3,200 tweets from a certain end date (the end of the election campaign). I have also seen the option of a Full archive endpoint, which would allow me to retrieve old tweets, but this does not directly enable (correct me if I am wrong) the targeting of specific users. Is there any additional option you would recommend to deal with this? Or would you rather directly retrieve each of the tweets using the IDs (although this would be too manual)?
Apparently the best way to do this is to use the Archive Search API. It is part of the premium API, so you first need to be granted an application with connection to the Academic Research API, and then opening a premium environment that lets you access the Archive Search API.
Once in the Archive Search API, you can specify dates (they are parameters of the request) and specific users with parameters within the query. An example here with twarc2 (Python): https://twittercommunity.com/t/twitter-api-timeline/171849/4?u=aguperonodo
In rtweet, this functionality can be implemented with the search_fullarchive function.

How do I get all retweets or the retweeters of my own personal tweet?

I know you must be thinking that its impossible or its been asked already.
But I have 2 queries. The first is that by using Twitter API, using an access token of my own profile, can I get all (more than 100) the retweets of my own tweet? Not someone else's, as all previous questions at stackoverflow have been asked.
Because there's a difference in private and public tweet and getting data related to it.
Secondly, if we cannot get more than 100 retweets, then how does this app Pickaw (formerly Twrench) https://pickaw.com/en gets all the retweets even if they're more than 500 and the corresponding data?
Any ideas?
The Twitter API only provides access to up to 100 Retweeters (IDs for users that RT'd a Tweet), regardless of whether this is your owned Tweet, or another one.
As for a specific app, it is only possible to speculate, unless the source code was Open Source and available. I would suggest there are two ways to get all the Retweets:
pay for premium or enterprise search access, and use the advanced PowerTrack rules to find Retweets of a specific Tweet ID;
use the Account Activity API webhooks to track whenever a user's Tweet is Retweeted. Not that this would only work in a real-time tracking case; you wouldn't be able to check historical Tweets.

Is it possible to identify the person talking to the google assistant by voice?

Recently google has added multiple user support to the assistant so how would use the API to identify the person by voice?
It depends what you mean by "identify the person".
There is no way for an Action to get the raw audio, so there is no way for it to do voice printing or anything along those lines.
Although each voice has to be reported against a Google User ID, you do not have direct access to that user ID.
What developers do have access to is a UID that is sent along with each request to your fulfillment server. This UID is consistent across requests, although it can be reset by a user (for example, if they reset their Google Home). You can think of this the same way you think of an HTTP cookie - you can track the UID and, if you see it again, have reasonable assurance it is the same user that accessed it last time. This breaks down, however, for the "default" account on Google Home, since anybody who doesn't have an account will map to this user.
Beyond this, you can also use Account Linking to connect a Google Account consistently to an account in your own system. If you have sufficient authentication in place, or are using one from Google or Facebook for example, this can act as an identity.
There isn't an API for developers to identify users by voice.

Get media from public accounts with instagram API

I'm working for a company that displays content on big screens located on public places like GYMs or waiting rooms.
One client asked app that shows Instagram content from celebrities accounts, so I created one using the Instagram API.
The problem is that the app is in sandbox mode and it gets blank data.
It seems I can only show media from sandbox users (not Beyonce), when I submitted for review it was rejected because it doesn't meet the requirements.
Is there a way to make it work?
During tests I used a valid access token I found on internet, but I don't think that is a valid solution.
You are correct, when app is in sandbox mode you are only able to see data on Instagram from sandbox users which you have set in advance. You won't get any public data on Instagram in this mode.
According to the API, your app doesn't have the criteria required to get approved.
From the Permissions Review page:
Valid Use Cases
We will approve submissions of apps that fall into these use cases:
To help individuals share their own content with 3rd party apps
To help brands and advertisers understand and manage their audience and
digital media rights
To help broadcasters and publishers discover content, get digital > rights to media, and share media with proper attribution
They also listed use cases of applications that won't get approval and it seems like your app matches one of them:
Here are some examples of scenarios that will not be approved:
One-off projects. If you are an agency building websites or other integrations, note that we don't grant permissions to clients created
for one-off projects. If you are interested in building a product,
platform, or widget that will be used as a service across multiple
projects, then you may submit a single client_id that you can use
across multiple projects
...
To get approved you should modify your application to correspond with criteria, perhaps build multiple projects?
You can also try to pull down the data from this URL: https://www.instagram.com/<username>/media/
For Beyonce account, use: https://www.instagram.com/beyonce/media/
Lastly, the access token is unique per-app, so you can't be using a random one. Here is a tutorial on how to generate access token for your app.

google drive used space report in google apps domain

Anyone knows if it's possible to get a report with free/used google drive space for each user? Something similar to "account report" https://developers.google.com/google-apps/reporting/#accounts_report but for Google drive?
thanks
There's no report autogenerated but all the data is available.
You can grab a list of all users in your Google Apps instance with the Provisioning API:
https://developers.google.com/google-apps/provisioning/#retrieving_organization_users_experimental
You can authenticate to Drive API as each user using a service account that has been granted domain-wide authority:
https://developers.google.com/drive/delegation
Lastly, you can determine the user's current usage as well as their quota using the about() API call:
https://developers.google.com/drive/v2/reference/about/get
this will give you a real-time view of user usage and quota (as opposed to a report that can be up to 24 hours outdated)