Retrieve a list of country names using Google places api - google-places-api

How can we get a list of countries/stats/cities in the world using Google places API? Using either google api javascript library or google api web service interface.

I don't believe that's allowed under the license terms of the Google Places API.
Instead, I suggest using http://geonames.org. Their data is updated very frequently and is licensed under a Creative Commons attribution license:
http://creativecommons.org/licenses/by/3.0/
For country names & stats, the file is located here:
http://download.geonames.org/export/dump/countryInfo.txt
All available downloads are here:
http://download.geonames.org/export/dump/
So, to get the list of all places within a country that you requested, just fetch the zip file with the 2-letter ISO country code. For example, to get all places within the United States, fetch this file:
http://download.geonames.org/export/dump/US.zip
Once fetched, you further have to filter the list in order to only get the cities.
Alternatively, if you're ok with just cities with population > 1000, use this file:
http://download.geonames.org/export/dump/cities1000.zip
In fact, I recommend the 2nd approach, because all cities can be a very big list.
For more info and a list of all the files available:
http://download.geonames.org/export/dump/readme.txt
Good luck on your project!

Updated on 29 Jan 2022
For the country list and it's full detail download json file form this link. and use it in your project https://drive.google.com/file/d/1VBsGFi20SHElkQp82LP0EwZGEzQMQjWc/view.
Its free for use

Related

How to get teamDriveId when use google-drive-api?

I use google-drive-api to get list of files.
I see a parameter named teamDriveId,I don't know where I can get the value of this parameter.
Can you get teamDriveId from the response of a method of this api?
Which method did you get it from?
I see team drive from here.
Team Drives are only available to G Suite Business and G Suite Enterprise customers.
The teamDriveID could be found at the last part of the URL of your Team Drive. it can easily be identified because of it's unique alpha-numeric combination.
See example below:
https://drive.google.com/corp/drive/folders/AbCDeFgH-123XXx
See this post from Gsuite Help Forum.

Does the JIRA REST API support querying a list of labels?

I see the is the ability to get all components of a project by doing
/project/[projectkey]/components
but I don't see any capability or documentation on how to get the list of labels that are available for a project (something like:
/project/[projectkey]/labels
Does the JIRA REST API support querying the list of labels available on a project?
Just to clarify, labels (at least the built-in JIRA ones) are global entities so they can be attached to any Issue in any Project.
As to your question - no, there's no public REST endpoint to get/change/add labels to JIRA.
Jira Cloud has /rest/api/3/label.
Jira Server provides /rest/api/2/jql/autocompletedata/suggestions?fieldName=labels which is however not paginated and only returns the first few labels (label values can be queried using &fieldValue=X).
However, as hacky workaround you can misuse the API endpoints some Atlassian Jira Gadgets are communicating with. Though this has the following disadvantages:
Are internal APIs
Atlassian apparently plans to replace Gadgets with Dashboard Items eventually
Might change behavior, see e.g. JRASERVER-67446
No pagination (?), responses can be huge
Responses are designed for Gadgets, therefore contain irrelevant data
Labels Gadget
/rest/gadget/1.0/labels/gadget/project-<PROJECT_ID>/labels
Where <PROJECT_ID> is the numeric ID of the project.
Heat Map Gadget
/rest/gadget/1.0/heatmap/generate?projectOrFilterId=<PROJECT_OR_FILTER>&statType=labels
Where <PROJECT_OR_FILTER> can be either:
project-<PROJECT_ID>
filter-<FILTER_ID>

Google Analytics Reporting API filters/segements

I'm trying to use the Google Analytics Core Reporting API and have the following troubles. I know how to fetch that I want the problem I have is:
I want to use a filter only for specific metrics and not for all of them.
Is this even possible?
Here is an example how my Reporting "Code" looks like:
Metrics "ga:sessions
ga:goal6Completions
ga:goal7Completions
ga:goal10Completions
ga:totalEvents
ga:uniqueEvents"
Dimensions "ga:date"
Filters "ga:eventCategory==customerType"
I have the same problems with segments as with the filters that all metrics all segmented/filtered and only specific metrics should.
There really isn't another way other to get the data you want without creating a new request where the filter isn't applied unfortunately.
Just remember that you are only allowed five requests total. To give context, this may only apply to how I use the Reporting API, but I use Google App Script to push data to Google Sheets.
This may or may not be helpful to you, but the reporting code I use I have made available in a repo on GitHub: https://github.com/jessfeliciano/aggregateGoogleAnalyticsReporting/blob/master/objectQueryWithFilter.js
I've included a guide that gives additional information regarding creating requests in general, so it may spark other ways to go about creating your data trees. I hope this helps.

Google Drive apis > revisions > publishedLink <undefined> for a document

Google Drive apis > revisions provides documentation for publishing Google Docs. when we access revision resources, we can get revision ids, exportLinks etc as mentioned in documentation.
There is one property 'publishedLink' mentioned in documentation which we can update and access. I tried it. In the request response, I get publishedLink for a spreadsheet, but I get publishedLink: undefined for a google docs document. What should be the reason?
For Google docs it doesn't seem to populate the publishedlink string but you can easily build it yourself. As I use PHP heres what I use:
print "https://docs.google.com/document/d/".$fileId."/pub";
$fileId is the id of the published file.
An example link would look like this
https://docs.google.com/document/d/1oKGvOIPjjGLRN1kYYVvNTgV_VDKt8NKcLFJuGiO-sDI/pub

What time zones does Outlook 2007 support in iCalendar invites?

I understand Outlook only "partially" conforms to the standard. Does Microsoft have a published spec on what they do conform with?
I need a list of the available time zone id's I can use for Outlook meeting invites.
I'm using ical4j to build my invite. I found the ical4j-zoneinfo-outlook project, and it works for the basic America/Chicago and America/New_York time zones. Overall I can't get a list of the complete available id's from this library, and it won't support basic "GMT-6:00".
Any ideas? Thanks!
The best way to get a full list of timezone ids for iCal4j is to check the http://tzurl.org/zoneinfo-outlook website. This is the source for ical4j's timezones.
Note that you still need to either manually or programmatically traverse the site to get all the valid ids.

Resources