Our Research
APIs
An application programming interface (API) allows two applications to directly connect and interact with each other with no user intervention. They help softwares communicate and exchange data efficiently. There are four different types of APIs: open, partner, internal, and composite. An open API is publicly available to use and there are no restrictions on users. Partner and internal APIs on the other hand have limitations regarding users. A partner API is not available to the public, a user is required to have specific rights or licenses to access it. An internal API is completely private, these are typically developed by companies and tailored for their systems and teams to use. Some APIs use a combination of the types mentioned above, an API using more than one type is called a composite API.
For our project, we found a YouTube Music API. This API is able to do a lot within YouTube Music, however, we are primarily using it for the search feature. We were able to implement this API into our server so that a user is able to type in a search request, which is then sent to YouTube Music. The data that the user entered is then proxied in the YouTube Music algorithm and then the administrator (the server in this case) receives a dictionary containing information about the search results. From this information, we are able to collect the song title and artist name and then add it to a list that contains our running queue.
Python and HTML Integration
Flask is a framework that is written in Python that allows Python and HTML to work together. In general, a framework is a collection of packages/libraries that allows developers to easily build web applications that are able to accept and respond to HTTP requests. By itself, Python web development is difficult, so having an intermediate program simplifies this process. However, Flask is considered a micro web framework because it doesn’t rely on other tools or programming libraries to function, it instead takes scripts such as Python scripts and uses them to perform back-end processes on a website. Flask is analogous to a software like Android Studio which has the ability to create a link between the coding language Java and the visual language XML, in much the same way we need a fast and light way to link Python and HTML. Flask is able to create this link to take the data processing abilities of Python and translate them into back-end processes which create functionality on an HTML website much like Android Studio does for Android applications using Java and XML.
Servers
Networks with data transfer security such as the St. Norbert College network do not allow data to be transferred laterally from device to device, this is to prevent those on the same network from stealing sensitive data or transferring malignant files or data. In order to make wireless communication between devices more secure and to separate data streams we use servers. Servers use server and client sockets to send data between devices via broadband using a port. A socket is simply one endpoint in a two-way data stream. A client socket is the device requesting permission to send and receive data from the server and the server socket is the coded model which controls whether or not client sockets have the correct credentials to transfer data, the port is the data stream they are using which corresponds to a code. Users who are accessing a server can then be differentiated by their host address which is specific to their device and network and their port which, in turn, is specific to the server they are accessing. Using this information, we can generate an integer code which is specific to each client/server data stream.
For our project we can use a local server which is specific to a single device to test functionality. Here we can use Python coding on a built-in socket class to collect, decode, create, encode, and send data between a server socket and a singular client socket. This is an effective way to test functionality before hosting multiple clients on a local Linux server.