text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
knows how to access particular | 5,488.04 | 3.18 |
properties that appear before the colon | 5,489.72 | 3.96 |
and get access to what those values are | 5,491.22 | 5.67 |
which appear after that colon as well so | 5,493.68 | 5.25 |
JavaScript object notation otherwise | 5,496.89 | 4.2 |
known as jason offers a very convenient | 5,498.93 | 4.08 |
representation and this isn't exactly | 5,501.09 | 4.8 |
what the JavaScript object syntax is in | 5,503.01 | 4.5 |
JavaScript objects you don't strictly | 5,505.89 | 3.3 |
need the quotation marks around the keys | 5,507.51 | 3.66 |
you could just say origin colon and not | 5,509.19 | 4.11 |
origin in quotation marks so JavaScript | 5,511.17 | 4.35 |
object notation uses slightly different | 5,513.3 | 4.44 |
syntax but ultimately very reminiscent | 5,515.52 | 3.93 |
what we've seen in JavaScript objects | 5,517.74 | 3.81 |
and JavaScript knows how to take data in | 5,519.45 | 3.99 |
this form and turn it into something | 5,521.55 | 3.81 |
like a JavaScript object and turns out | 5,523.44 | 3.42 |
there ways of doing this in Python as | 5,525.36 | 3.09 |
well in other programming languages have | 5,526.86 | 4.41 |
the ability to interpret JSON data in | 5,528.45 | 4.89 |
order to use it in some meaningful way | 5,531.27 | 4.44 |
and another advantage of the JSON | 5,533.34 | 4.38 |
representation is it is very conducive | 5,535.71 | 4.5 |
to representing structures of things so | 5,537.72 | 4.2 |
these values don't just need to be | 5,540.21 | 4.38 |
strings or numbers they could be lists | 5,541.92 | 4.44 |
or arrays that happen have a sequence of | 5,544.59 | 3.96 |
possible values or they could even be | 5,546.36 | 4.29 |
other javascript objects that if we | 5,548.55 | 4.2 |
wanted to represent not just a city name | 5,550.65 | 4.23 |
but represent the city name and the | 5,552.75 | 4.02 |
airport code for example as we saw that | 5,554.88 | 4.08 |
we wanted to do before I could instead | 5,556.77 | 4.2 |
of having origin be equal to a string | 5,558.96 | 4.56 |
like New York have origin be equal to | 5,560.97 | 5.01 |
yet another JavaScript object that | 5,563.52 | 4.89 |
contains a city property and a code | 5,565.98 | 3.78 |
property where the city is the name of | 5,568.41 | 3.57 |
the city and the code is the name of the | 5,569.76 | 3.96 |
airport code and the important thing is | 5,571.98 | 3.54 |
as long as I and the person I'm | 5,573.72 | 3.66 |
communicating with agree upon this | 5,575.52 | 3.99 |
representation agree upon what the names | 5,577.38 | 4.11 |
of these keys are and what the structure | 5,579.51 | 4.74 |
of this JSON payload this JSON object | 5,581.49 | 5.04 |
happens to be then the person on the | 5,584.25 | 4.2 |
receiving end can take this data and | 5,586.53 | 3.6 |
write a program that's able to interpret | 5,588.45 | 3.63 |
it and use that data in some meaningful | 5,590.13 | 4.23 |
way and so we'll see an example of this | 5,592.08 | 4.41 |
now of using javascript to be able to | 5,594.36 | 3.51 |
communicate with yet another online | 5,596.49 | 3.93 |
service in particular for accessing | 5,597.87 | 4.8 |
information about currency exchange | 5,600.42 | 3.78 |
rates currency exchange rates are always | 5,602.67 | 3.36 |
changing we want access to the latest | 5,604.2 | 4.2 |
currency exchange rate data and if there | 5,606.03 | 4.32 |
is an online service an API that | 5,608.4 | 4.14 |
provides access to that data in JSON | 5,610.35 | 4.11 |
form in a format like this that is | 5,612.54 | 3.87 |
machine readable then we can use that | 5,614.46 | 4.77 |
data to write a stock a currency | 5,616.41 | 5.16 |
exchange application that uses real time | 5,619.23 | 2.88 |
data | 5,621.57 | 2.79 |
in order to make those conversions what | 5,622.11 | 3.839 |
might that data look like well the data | 5,624.36 | 3.449 |
could look something like this that we | 5,625.949 | 3.841 |
make a request for accessing what are | 5,627.809 | 3.81 |
the exchange rates for converting from | 5,629.79 | 4.17 |
US dollars of the West Newton is USD and | 5,631.619 | 4.951 |
we get back a JSON object that looks | 5,633.96 | 5.79 |
like this and it has a base key of USD | 5,636.57 | 5.549 |
and then has a rates key that has a | 5,639.75 | 3.659 |
whole bunch of rates within it so | 5,642.119 | 2.881 |
conversion to euros and Japanese yen | 5,643.409 | 4.051 |
great british britain pounds as well as | 5,645 | 4.079 |
Australian dollars and all of the | 5,647.46 | 3.06 |
various different currency exchange | 5,649.079 | 2.58 |
rates for all of these different | 5,650.52 | 3.659 |
currencies for example and this doesn't | 5,651.659 | 4.351 |
have to be the way that this data is | 5,654.179 | 3.121 |
structured but it happens to be a | 5,656.01 | 3.33 |
convenient way and so long as the person | 5,657.3 | 4.68 |
providing this data to me and I both | 5,659.34 | 4.649 |
know what this structure is we can begin | 5,661.98 | 3.929 |
to write programs that are able to use | 5,663.989 | 3.9 |
that data and so will now see our | 5,665.909 | 6.301 |
example of an API which is exchange | 5,667.889 | 7.951 |
rates API I owe and if we go to API dot | 5,672.21 | 6.21 |
exchange rates API am / latest and | 5,675.84 | 5.069 |
provide a get parameter of base equals | 5,678.42 | 6.09 |
US dollars then what we get back is data | 5,680.909 | 4.851 |
that looks like this | 5,684.51 | 3.45 |
now it's a little bit messy looking not | 5,685.76 | 4.12 |
nearly as clean as we saw before but | 5,687.96 | 3.63 |
it's the same exact thing just without | 5,689.88 | 3.239 |
the whitespace we have a JavaScript | 5,691.59 | 4.259 |
object that has a rates key that tells | 5,693.119 | 4.891 |
me all right here is the exchange rate | 5,695.849 | 4.801 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.