API to get a list of cities and states - database

We run an app that asks users to select their country, city and state. We wanted these to be dropdowns with prepopulated values.
I went on the internet and amazingly I couldn't find a reliable source on getting countries, cities, and states/provinces through an API.
I wanted to know what is the industry standard for this since almost all e-commerces require this

Related

How to track a particular page without using google anlytics?

I am working in an application where a product detail page need to be tracked without using google analytics.I have a scenario where a product is trending or not.To achieve that I need to get the views of that page.A Product which is having more number of views is considered as a trending.This trending may change in day-to-day life.
Done some research https://github.com/nytimes/react-tracking
But didn't get any perfect solution.Need help to add this functionality.

"Dynamic" paths in React.js

I'm new to React.js, so maybe my question is dumb, but I've searched a lot for this information and I just haven't found it, so let's ask.
I've already learned the basics of Router in React, and I can create simple routes, as to say:
My main page is in localhost/
My about page is in localhost/about
My contacts page is in localhost/contacts
You can see an exemple of what I'm talking about here: https://codesandbox.io/s/react-router-dom-example-8vcqu?from-embed. So, I know how to create a application like this.
But I didn't get a clue of how to create an routing system to give me the following:
When the user select School A, React lead the user to localhost/report/school_a
When the user select School B, React lead the user to localhost/report/school_b
When the user select City Z, React lead the user to localhost/report/city_z
When the user select City W, React lead the user to localhost/report/city_w
Considering that a school report presents the same layout for all schools, as a city report presents the same for all cities (what changes is only the data showned). Also considering that I have something like 3.000 schools to share reports.
All I wanna know is what topic I need to study to understand that (i.e.: dynamic routing?). You can assume I'm not getting the basics correctly, as I'm newbie to all this. Maybe I even not getting API concept correctly.

Loading the Market Price for ETH-USD using Coinbase-Pro-Trading-Toolkit

I am using the Coinbase-Pro-Trading-Toolkit (Coinbase Pro API)
There are several ways to get the market price using the toolkit. I am not trying to run a live feed, I simply want to use the API, so I'm looking at a couple different methods:
publicClient.getProductTicker(product)
coinbasePro.loadMidMarketPrice(product)
Both of these work great when I pass in a product of "BTC-USD". But when I try passing in "ETH-USD" it fails. Are these methods designed to work with certain products?
Okay I feel silly with this one. The issue was that I was using the sandbox api and not all products appear in the Sandbox API. Only API calls to Coinbase Pro’s production site will produce a full result set.
Good news is that all products have same attributes and therefore testing in the Sandbox is possible.

How to Add Records to 2sxc data from DNNSharp's Action Form

We have DNN Sharp's Action Form being used by client-partners to post new job listings. The Locations and Categories for these jobs are managed in a little 2sxc apps. We want to extend the ActionForm a little so that the user has the ability to add a new Location or Category when they post the job listing.
What method/action would I use in Action Form to be able to add a record to Locations or Categories data which are both inside the 2sxc App?
At the moment there is no quick way, because there is no adapter. You could create some manual code or create an adapter - but that's probably a day or so of work since you probably don't know the Action-Form APIs for all that.
But if you do do it, please share :)
I had a similar project. I wanted a form configuration tool for commonly used forms so that a staff person could fill out date, price etc. without getting under the hood.
I kludged it together using
var formFields;//Angular Controller For Form Fields
formFields = getScope('ActionFormCtrl').form.fields;
Then shoved in my 2SXC values
formFields.EventDate = "#Content.SessionDates";
formFields.$digest();
This is definitely not the angular way but it does work. Note that you need to run the JS after the form is rendered.

How big online shops store product pages

just a question from curiosity. How big online stores with lots of products (can) store their product pages?
I know one solution might be database and then generating the content on demand, but how would they be able to hand URL requests like www.onlinestore.com/productname.htm? (Specificaly I mean this store http://www.alza.cz/pevne-disky/18842851.htm ). Every product links to productname.htm page.
Is it possible (and viable) to have all product pages pregenerated?
The answer will vary from vendor to vendor, but typically this is achieved with a combination of custom URL routing, and a server-side, database-driven language like ASP.NET or PHP.
In the case of your example, it is likely that the "18842851" of http://www.alza.cz/pevne-disky/18842851.htm is actually a product Id, and their server is parsing that product Id in order to get the correct product content from a database. With the content in-hand, the server can then return a reusable template.

Resources