It might be really simple but I cannot figure it out. I made a little script that is able to upload some photos/video using rest API.
Since they all count towards the storage quota (15gb free) I would like to query the remaining free space.
How do I do this?
You can retrieve your storage quota with the method About:get, setting the query parameter fields to storageQuota
This will give you the following information:
Your remaining quota can be calculated as "limit" - "usage", in my case around 1,5 GB which is in agreement with the information I can see from the user interface in Google Drive and Google Photos.
Related
I'd like to determine how much disk space my Azure blobs are using via Azure's Java API. Basically, I'd like something similar to Unix's df command:
>df
Filesystem 1K-blocks Used Available Use% Mounted on
C:/Tools/cygwin64 248717308 217102536 31614772 88% /
I've tried a variety of things, hoping that the information I want is in the CloudBlobContainer's metadata or properties, but apparently not. I've run the following code and examined the various variables in the debugger, but haven't seen anything close to what I'm looking for.
CloudBlobContainer container = ...
try {
AccountInformation accountInfo = container.downloadAccountInfo();
container.downloadAttributes();
HashMap<String, String> metadata = container.getMetadata();
BlobContainerProperties properties = container.getProperties();
String string = metadata.toString();
} catch (StorageException e) { // ...
I'm hoping I don't have to recursively process all of the blobs in the container. Is there a better way?
For the individual blob container, the approach you're using is the only approach available today though I must say that it is not very efficient as it will only account for base blobs and not blob snapshots and versions. Furthermore if you're using page blobs then it will report the total capacity of those page blobs instead of occupied bytes.
However if you want to get the storage size for the entire storage account, one approach you can take a look at is Azure Storage Metrics. One of the metric available there is BlobCapacity which will tell you the total number of bytes occupied by all blobs in your storage account. You can learn more about the available metrics here: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported#microsoftstoragestorageaccountsblobservices.
Other option would be to look at consumption data through billing API. It's not that straightforward but it will give you the most accurate numbers because the numbers ultimately translate to your Azure bill. The REST API operation you would want to call is Usage Details - List.
Hi i am writing android app that lets users take videos and upload them to youtube, as of now i am not anticipating any where close to reaching quota since Im still developing the app. But I am worried since the limit is 1,000,000 units per day, I will eventually cross it.
So how do we increase it, I noticed under the quota tab there is an option, clicking it brings up a form. But it doesn't mention how much will it cost me to increase the limit? Also I couldn't find any google support page so I am asking it here
thanks
With the current quota, you can upload near 660 videos a day. If you get close to that number you can fill that form which is a long form and you need two cups of coffee and perhaps more than 2 hours to do it. In around 48 hours, they will send the result and will approve it, if your app behaves compatible with "terms of service". And it's free.
Cheers.
Edit
It is not documented anywhere, but very recently (almost since the day I answered this question), YouTube has changed the data-api, that each day it accepts 50 videos, and afterward it accepts only one video per 15 minutes. And because it is just applied without being documented nor explained by YouTube, we cannot anticipate what the limitation is going to be.
Is it possible to get all postal codes in a given location inside the given radius?
What Google API should I use?
Example: I have a lat. and a long. and my radius is 15kms. How do I get the post codes of the areas inside the radius?
I'm kinda new to using API's and Google API's.
Thanks!
This is a process called "Reverse Geocoding" Google offers it here - https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse
However pretty sure that Google's API will try to give you one closest result rather than many.
You can do this with APIs (often paid for) however, be warned that you have to be quite careful with the radius element, setting it too small in rural areas will bring back 0 results and setting it too big in urban areas will bring back potentially thousands.
Let's say you have an app where your user will authenticate with Picasa and Facebook in order for you to get all of the photos they have posted. To simply get all of a user's photos, both FB and Picasa require the same approach:
Get a list of albums for the user
Get a list of pictures for each album
So for any given provider with this approach, you are required to make N + 1 (N being number of albums) requests to the 3rd party. If you are doing a couple of these operations at once this seems like it would get preventably slow.
There seem to be a few alternatives to this approach:
Facebook:
Get all photos related to user
Parse these to find which were actually posted by the user
This will also give you other users' photos tagged with your user, so it may potentially end up performing worse than the original method due to sheer size of data as well as the number of request for paging involved.
Picasa:
There's a potential workaround here:
Get all photos from Picasa by person
That would probably work but seems hacky, i.e. what is a very high value that satisfies the allowable range but can still be guaranteed to be larger than the number of photos for the user.
I know this is not going to be fast no matter which route I go, but does anyone have suggestions on what I should do here? There's also always the possibility that I'm looking at it completely wrong too.
I suggest you use FQL->
http://developers.facebook.com/docs/reference/fql/photo/
and
http://developers.facebook.com/docs/reference/fql/photo_tag/
It allows you to make one big query and facebook process it on their end, you can tweak it so it returns to you a list of pictures where user is tagged in for example.
I'm sorry I can't help with Picasa though, I never worked with it.
I'm using the WhitePages API ( developer.whitepages.com ) to get a phone type (landline or cellular) and the phone's service provider (Verizon, T-Mobile, etc), but they only have a personal API which limits you to 2 calls a second and/or 1,500 calls a day. The paid version, or "Pro", is a minimum of $500 a month and/or $0.10 a call.
Does anyone know another service where I can get that information for free or cheaper than $500 / $0.10 a call? If not I'll have to try to cache everything and it'll technically be against their TOS...
We've tried using NetNumber and TargusInfo. Maybe you want to look at them. Not sure how much they cost though.
How much volume are you trying to do?