Hardware Reference
In-Depth Information
Data Through APIs
An API is the way that a programmer can interact with the operating system underneath it. In the web world, an API
governs how your scripts can retrieve (and sometimes change) the data on a web server. These break down into
several broad groups:
u Basic file access : These files are dispensed via a web server with a filename formatted
according to some predetermined rules. To get the UK TV listings for BBC1 in three days' time,
for example, you can use the URL http://www.bleb.org/tv/data/listings/3/bbc1.xml . In
the truest sense of the word, these are not APIs but REST requests. However, unlike static files,
the same request can produce different data according to the time or location from where
they're requested.
u Public queries : These can exist in many forms, including basic file requests, but they are
usually based on Simple Object Access Protocol (SOAP) objects or XML over HTTP. This
allows function calls, using strongly typed parameters, to be sent to the server with similarly
complex replies returned using XML or JSON.
u Private queries : These require the software developer to sign up for a developer API key. These,
like the ones for Amazon, are embedded into your code so that the server API can authenticate
the user and monitor your usage patterns, thereby eliminating most DoS attacks.
There is no consistent legalese to these implementations. Just because a site uses publicly accessible files doesn't
necessarily mean that you can redistribute their data. Again, you must check their terms of service (TOS), which are
not always obviously displayed.
In the case of private queries, the TOS will be displayed beforehand, and you will be required to agree to the
terms before a key is assigned to you. These terms will typically limit you to a specific number of accesses per day or
within a particular time frame. Usually these limits can be increased with the exchange of currency.
If you are looking for APIs with which to experiment, then a good starting point is
http://www.programmableweb.com/apis .
Distribution
Unless it is explicitly stated otherwise, any data that you generate is considered a derived work of the original
copyrighted version. I have merely demonstrated methods by which this data can be obtained (and obtained for
personal use only). After all, in most cases, the copyright holders have given their permission for the data to be used
on the sites in question but not redistributed beyond that. The letter of the law includes redistribution inside your
home, but in most cases (where the home server is private and unavailable to the outside world), it becomes a
moot point.
Public Data
In this section, I'll cover data that is available to the public. It is not necessarily available in the public domain,
however, so you must still adhere to all of the rules of legality mentioned previously. Within each section I'll cover
some example data that will be useful to your smart home, examine how to access and process it, and talk about ideas
of the ways in which public data can be incorporated privately at home.
TV Guides
With so many TV stations in so many countries, building a general-purpose data store for all the TV channels (let alone
their programs) in the world is a massive undertaking. In the United Kingdom, you have Andrew Flegg to thank for
handling all the digital, analog, and primary satellite stations in England, Scotland, Wales, and Northern Ireland.
Search WWH ::




Custom Search