Читать книгу Bots - Nick Monaco - Страница 19

APIs – How bots connect to websites and social media

Оглавление

Before diving into the main categories of bots, we’d like to note the importance of Application Programming Interfaces, or “APIs” in driving bot development in the modern era, the tool through which most social media bots connect to do their work. Social bots proliferated dramatically in the early aughts and the 2010s, largely as a result of more widespread connectivity, the declining cost of computing and bandwidth, and the rise of social media. Social bots are not confined to any one particular platform – they can appear on basically any social media platform, including Twitter, Facebook, Instagram, Gab, Reddit, and YouTube; encrypted chat applications like Telegram and LINE; or regular websites more generally (Assenmacher et al., 2020; Boshmaf et al., 2011; Confessore et al., 2018; Dubbin, 2013; Massanari, 2016; Monaco, 2017; Morales, 2020; Read, 2018; S. Woolley et al., 2019). (We will talk more about how social bots are used on each platform in our chapters on social and political bots.) But the technical design of certain platforms makes them more hospitable to bot activity. This has to do with the website’s API.

APIs are a sort of platform-behind-the-platform, a place where computer programs can easily gather data and/or interact with users on social media sites. The data that computer programs can gather from APIs, as well as what actions they can perform on the site, are pre-defined by the architects of that API. For example, on Twitter, computer programs can post messages from a Twitter account, follow other users, or retweet other users’ posts, among many other things (Zi et al., 2010). Bots that use API access are generally fairly easy to program and can be easily created by people with little technical skill. Many of the bots on social media sites, especially the earliest incarnations, were relatively simple bots that used APIs (Woolley, 2020a).

It is also possible to program bots that interact with users on social media sites without using APIs. These bots typically imitate human users by accessing a website through a browser (such as Google Chrome or Mozilla Firefox) to interact with specific parts of the website. These bots perform the same functions as human users by following a set of programmatic instructions. They can run invisibly on a computer, and for this reason are often referred to as “headless” (a reference that uses a visible browser as a metaphor for a head). Headless bot behavior can be automated using software packages such as Selenium, Puppeteer, and PhantomJS.12 For example, a skilled developer could use Selenium to write a program that launches Mozilla Firefox, logs into Twitter, and composes a Tweet that uses the top trending hashtag in the US and includes the @-mentions of three other users who recently used the same hashtag. Generally, headless bots and scrapers require a fair amount of technical skill to program, and they are more useful for passive intelligence and data collection than for direct interaction with other users. However, tutorials for programming these bots are freely available online (Mottet, 2019).

Bots

Подняться наверх