Google calendar from Django - django

I have a monthly schedule what is changing very often. I want to link it with google calendar to see schedule changing there.
What is the best way to do that? Generate CSV file?
I want to let google calendar auto update it.

I have never used it, but you might find the Google Calendar API useful. It says one of the languages it supports is python, so you should be able to use it with Django.

Related

Better way to get last modified time for Google contact using Google people API

I use the Java Google People API to sync Google contacts with a desktop application. To do it, I need to get the last modified date/time for each Google contact. For that, I have been using updateTime in the Source field, which I get by iterating over person.metadata.sources.
But it sometimes returns a date/time which is more recent than the date/time of when I actually updated the contact. And that causes the contact to get synced unnecessarily. I wonder if Google is touching my contacts periodically in the background which updates the updateTime. If so, is there a better way for me to get the "real" update time for a contact?
Thanks.

Is there a Google Places API return field for restaurant dining options (ie. Dine-In, Takeout, Delivery)?

During the pandemic around March, Google started allowing business owners to tag their restaurants with the dining option they offer in light of the pandemic.
Here is an example of these tags
I was wondering if the Places API (or any other Google API) has the ability to return these dining types. I've checked the docs for the Places API and it seems to only be capable of returning the business' business_status which only includes OPERATIONAL, CLOSED_TEMPORARILY, CLOSED_PERMANENTLY and not the fields I am looking for.
Would the only other way to obtain these tags be by web scraping a search result?
I just spoke with Google support and they said no. There is also no plan in the future to add these data points to the JSON.
They gave me some workaround ideas but nothing realistic. Let me know if you find a workaround! I am trying to gather this data as well.

How to generate uptime reports through Google Cloud Stackdriver?

I am a new user with Google cloud (Stackdriver).
I would like to set and generate uptime reports on a monthly basis which would include the past 4 weeks through e-mail in the cloud but I have not been able to find from where I could do this.
I have done research but have not managed to find what I am looking for. The closes I got to was TRACE but is still not what I would like to have.
It's not possible to generate that kind of reports using tools available in Google Cloud.
Using traces is probably the best you can do now - although you can try the Cloud Trace API which may give you a way to extract the information in a more structured way.
If you want this feature included in GCP please go to IssueTracker and create a new feature request with detailes explanation of what your goal is and mention the time-span you want to be able to get data from.

Finding latitude and longitude of many places once

I have a long list of towns and cities, and I'd like to add latitude and longitude information to each of them.
Does anyone know the easiest way to generate this information once?
See also Geocode multiple addresses
The first part of the third video shows how to get latitude and Longitude using Google Refine and geocoding. No need to write a new script. Ideal for doing this kind of change once.
http://code.google.com/p/google-refine/
Or use www.geonames.org - there's language APIs for that. Or Open Street Map's Nominatim: http://wiki.openstreetmap.org/wiki/Nominatim - google have slightly more restrictive terms of service.
You can use the Google Geocoding API. Check the API at this URL: http://code.google.com/apis/maps/documentation/geocoding/
What follows next is writing some code. I am doing something similar in C# and it is quite easy here.
Most geocoding services can handle queries with only administrative names which is what you're after, e.g., municipality and region. So I'd choose one you like that also handles batch or bulk requests, e.g., the Bing Spatial Data API (here's an article on batch geocoding with it.)
An alternative approach that might be useful if you're on a budget and have a lot of these to do would be to download the Geonames database and write a bit of code to import it into your database or index it; then query it however and how often you like, e.g., if you put your places in another table you could SELECT [...] FROM my_places LEFT JOIN geonames [...]. I used to import Geonames DB into a vanilla PostgreSQL nightly and probably still have the code in a git repo somewhere if that's a route you want to try (comment and I'll find it and attach.)
For a service that uses google, which I find most accurate.
Look at http://www.torchproducts.com/tools/geocode

Determining popularity of an item within a given date/time range

I'm working on a django website that needs to track popularity of items within a given date/time range. I'll need the ability to have a most viewed today, this week, all time, etc...
There is a "django-popularity" app on github that looks promising but only works with mysql (I'm using postgresql).
My initial thoughts are to create a generic ViewCounter model that logs views for all the objects that are tracked and then run a cron that crunches those numbers into the relevant time-based statistics for each item.
Looking forward to hearing your ideas.
Did you try django-popularity with postgres? The github page just says that the developer has not tested it with anything other than MySQL.
The app has only been tested with MySQL but it should fully work for Postgres with few adjustments. If you do manage to get it to work: please inforrm me. (I'm the developer.) I would love to be able to tell people this product is useable for Postgres as well.
Moreover; all the funcitonality relying on raw SQL checks whether there is actually a MySQL database in use. If not, it should throw an assertion error.
Also, the generic viewcounter is already in my package (it's called ViewTracker, but hell). The cron job seems too much of a hassle to me if we could do either SQL or Django caching as well.