Browse Source

went through comments and added bot example page

master
ccl 4 years ago
parent
commit
772788ee7c
  1. 2
      content/Section 2 - Harm in Computational Infrastructures/1-introduction.md
  2. 6
      content/Section 2 - Harm in Computational Infrastructures/2-introduction-seda.md
  3. 8
      content/Section 4 - Bot Logic/1-introduction.md
  4. 20
      content/Section 4 - Bot Logic/2-bot-logic-vs-platform-logic.md
  5. 24
      content/Section 4 - Bot Logic/3-examples.md
  6. 23
      content/Section 4 - Bot Logic/4-bot-behaviour.md
  7. 247
      content/bot-example/mastodon-bot-ccl.ipynb

2
content/Section 2 - Harm in Computational Infrastructures/1-introduction.md

@ -5,8 +5,6 @@ Summary:
Computational infrastructures are complex entities consisting of different technological, social, economical and political dimensions. As is the case with any type of infrastructure, also computational infrastructures come with embedded values. Their configurations shape the possibilities and restrictions of the system, defining what could be build on top and what not. Computational infrastructures are complex entities consisting of different technological, social, economical and political dimensions. As is the case with any type of infrastructure, also computational infrastructures come with embedded values. Their configurations shape the possibilities and restrictions of the system, defining what could be build on top and what not.
[note: This could be a good place to introduce a definition of what we mean when we refer to "computational infrastructures", also in relation to "platforms".]
In this section we will unpack how computational infrastructures operate and what impact that has on the digital systems that are being built on top of them. In this section we will unpack how computational infrastructures operate and what impact that has on the digital systems that are being built on top of them.
<!-- Who designs them? What values do they embed into digital systems? --> <!-- Who designs them? What values do they embed into digital systems? -->

6
content/Section 2 - Harm in Computational Infrastructures/2-introduction-seda.md

@ -3,13 +3,13 @@ Slug: 02-s2-introduction
Date: 2020-11-01 12:01 Date: 2020-11-01 12:01
Summary: *Computational infrastructures* and *POTs (Protective Optimization Technologies)* Summary: *Computational infrastructures* and *POTs (Protective Optimization Technologies)*
Seda Gürses is currently [delete currently] an Associate Professor in the Department of Multi-Actor Systems at TU Delft at the Faculty of Technology Policy and Management, a member of The Institute for Technology in the Public Interest and an affiliate at the COSIC Group at the Department of Electrical Engineering (ESAT), KU Leuven. Beyond her academic work, she also collaborated with artistic initiatives including Constant vzw, Bootlab, De-center, ESC in Brussels, Graz and Berlin. Seda Gürses is an Associate Professor in the Department of Multi-Actor Systems at TU Delft at the Faculty of Technology Policy and Management, a member of The Institute for Technology in the Public Interest and an affiliate at the COSIC Group at the Department of Electrical Engineering (ESAT), KU Leuven. Beyond her academic work, she also collaborated with artistic initiatives including Constant vzw, Bootlab, De-center, ESC in Brussels, Graz and Berlin.
Gürses' work provides us with handles to study computational infrastructures. The paper on *POTs (Protective Optimization Technologies)*[^pots] she co-wrote, for example, proposes forms of critical *optimization* practices. Such practices "aim at addressing risks and harms that cannot be captured from the fairness perspective and cannot be addressed without a cooperative service provider"[add page number]. The paper questions current "fairness" approaches, by questioning their limitations and creating space for community-inclusive ways to review them. Following Michael A. Jackson’s theory of requirements engineering, the paper [repetitive language use, perhaps "it"] also proposes to approach computational infrastructures as being far more than a technological system alone, thus shifting focus from the system itself to the economical, political and social context in which it operates. Gürses' work provides us with handles to study computational infrastructures. The paper on *POTs (Protective Optimization Technologies)*[^pots] she co-wrote, for example, proposes forms of critical *optimization* practices. Such practices "aim at addressing risks and harms that cannot be captured from the fairness perspective and cannot be addressed without a cooperative service provider"[add page number]. The paper questions current "fairness" approaches, by questioning their limitations and creating space for community-inclusive ways to review them. Following Michael A. Jackson’s theory of requirements engineering, it also proposes to approach computational infrastructures as being far more than a technological system alone, thus shifting focus from the system itself to the economical, political and social context in which it operates.
By questioning how technologies could *optimize* their mode of operation in a truly just way, *POTs* provide "means for affected parties to address negative impacts of digital systems" [page number]. The work departs from a thorough consideration of multiple forms of *harm* caused by computational infrastructures framed as *externalities*[^externalities]. Examples of such externalities include lack of privacy, discrimination, low wages and surveillance. How a *POT* could possible engage with them is furthermore illustrated through a range of activist, artistic and deployed examples of repurposed optimization technologies that "correct, shift or expose these harms". By questioning how technologies could *optimize* their mode of operation in a truly just way, *POTs* provide "means for affected parties to address negative impacts of digital systems" [page number]. The work departs from a thorough consideration of multiple forms of *harm* caused by computational infrastructures framed as *externalities*[^externalities]. Examples of such externalities include lack of privacy, discrimination, low wages and surveillance. How a *POT* could possible engage with them is furthermore illustrated through a range of activist, artistic and deployed examples of repurposed optimization technologies that "correct, shift or expose these harms".
We will introduce the work of Seda [delete first name to be consistent with elsewhere] Gürses and dive with her into the following questions: We will introduce the work of Gürses and dive with her into the following questions:
* What are computational infrastructures? * What are computational infrastructures?
* What are elements that shape (or are shaped by) computational infrastructures? * What are elements that shape (or are shaped by) computational infrastructures?

8
content/Section 4 - Bot Logic/1-introduction.md

@ -3,13 +3,13 @@ Slug: 01-s4-introduction
Date: 2020-11-01 12:00 Date: 2020-11-01 12:00
Summary: Bots as computational infrapunctures. Summary: Bots as computational infrapunctures.
*Infrapuncture* is a helpful term at a time when there is a lot of discussion around the political roles [perhaps be more specific, e.g. their undue influence in elections] of automated agents [maybe just call it bots?] in communication platforms. Making a bot can be a way to probe and understand potential forms of interventions, create new imaginaries or deflate existing hegemonic structures. *Infrapuncture* is a helpful term at a time when there is a lot of discussion around the political roles of bots in communication platforms, e.g. their undue influence in political elections. Making a bot can be a way to probe and understand potential forms of interventions, create new imaginaries or deflate existing hegemonic structures.
However, a bot always relies on the technical restrictions and possibilities of interaction defined by the infrastructure. In order to run a bot, a technical understanding of this infrastructure is therefore required. The API (Application Programming Interface) is an important entry point here. This technical framework provides a programming interface to communicate with a system. The API can be understood as a *door protocol* that is designed by the owner of an infrastructure, which eventually defines the technical imaginary of a platform. (*We dive a bit deeper into API's in Section 6, [click here](/02-s6-step-2.html#APIs) to go there directly.*) Bots rely on the technical restrictions and possibilities of interaction defined by the infrastructure on which they are operating. In order to run a bot, a technical understanding of this infrastructure is therefore required. The API (Application Programming Interface) is an important entry point here. This technical framework provides a programming interface to communicate with a system. The API can be understood as a *door protocol* that is designed by the owner of an infrastructure, which eventually defines the technical imaginary of a platform. (*We dive a bit deeper into API's in Section 6, [click here](/02-s6-step-2.html#APIs) to go there directly.*)
Before launching a bot into a digital environment, the bot maker does not only need to find a technical entry point, but also a social one. Writing a bot does not only imply technical knowledge about an API of a platform, [<- this part of teh sentence can be delted because repetivive] it also implies a thorough understanding of what determines the possibilities of interaction and the social norms established within a social environment. Before launching a bot into a digital environment, the bot maker does not only need to find a technical entry point, but also a social one. Writing a bot also implies a thorough understanding of what determines the possibilities of interaction and the social norms established within a social environment.
By introducing [what we call - claim your term!] *bot logic*, the aim of this section is to highlight the sociality that shapes (or is shaped by) bots. By introducing what we call *bot logic*, the aim of this section is to highlight the sociality that shapes (or is shaped by) bots.
<!-- The editor community of English Wikipedia consists, for example, of both humans and bots. The interactions between them go beyond the maintenance of Wikipedia. Instead, affective relations are formed wherein the bots are anthropomorphised. In the case of Wikipedia, it means that a bot maker needs to develop an understanding of the social dynamics of the community of editors and users of Wikipedia, in order to make a bot that is embedded well into the community. The understanding of Wikipedia's social dynamics are crucial in order to make a bot that can interact with the work of multiple individuals that edit Wikipedia, ranging from first-time editors, dedicated editors, groups coming together during edit-a-thon or different kind of trolls. And that's of course just one example. Bots act differently depending on the platform on which they are running. --> <!-- The editor community of English Wikipedia consists, for example, of both humans and bots. The interactions between them go beyond the maintenance of Wikipedia. Instead, affective relations are formed wherein the bots are anthropomorphised. In the case of Wikipedia, it means that a bot maker needs to develop an understanding of the social dynamics of the community of editors and users of Wikipedia, in order to make a bot that is embedded well into the community. The understanding of Wikipedia's social dynamics are crucial in order to make a bot that can interact with the work of multiple individuals that edit Wikipedia, ranging from first-time editors, dedicated editors, groups coming together during edit-a-thon or different kind of trolls. And that's of course just one example. Bots act differently depending on the platform on which they are running. -->

20
content/Section 4 - Bot Logic/2-bot-logic-vs-platform-logic.md

@ -7,21 +7,21 @@ Summary: *Bot logic* disperses, fragments, develops intimate knowledge & encoura
<!-- *Bot logic* refers to the situational effect of bots upon a socio-technical ecology and their potential to infiltrate and co-exist with server-side conditions. --> <!-- *Bot logic* refers to the situational effect of bots upon a socio-technical ecology and their potential to infiltrate and co-exist with server-side conditions. -->
The term *bot logic* is phrased as [claim your term!] a response to *platform logic*, which Jonas Andersson Schwarz describes as We propose the term *bot logic* in response to *platform logic*, which Jonas Andersson Schwarz describes as
> digital platforms enacting a twofold logic of micro-level technocentric control and macro-level geopolitical domination, while at the same time having a range of generative outcomes, arising between these two levels[^platformlogic]. [this needs a bit of further unpacking it is too abstract to comprehend now] > digital platforms enacting a twofold logic of micro-level technocentric control and macro-level geopolitical domination, while at the same time having a range of generative outcomes, arising between these two levels[^platformlogic]. [this needs a bit of further unpacking it is too abstract to comprehend now]
To unpack the term *bot logic* further, we will look at [replace will look at with explore]four differences between *bot logic* and *platform logic*. To unpack the term *bot logic* further, we will explore four differences between *bot logic* and *platform logic*.
---------- ----------
* Where platform logic accumulates, *bot logic* disperses * Where platform logic accumulates, *bot logic* disperses
On commercial platforms, the engagement of users equals [perhaps creates rather than equals] economic value that is translated through data capture and organisation. Metadata is extracted from users that then through pattern matching can be used to target users for advertisements. While bots can and do participate in this economy, they can also enable its sabotage. In the case of buying bot followers, this can be a means to generate noise in the collected dataset and blur the perception of the user as a set of behaviours that the platform has. On commercial platforms, the engagement of users creates economic value that is translated through data capture and organisation. Metadata is extracted from users that then through pattern matching can be used to target users for advertisements. While bots can and do participate in this economy, they can also enable its sabotage. In the case of buying bot followers, this can be a means to generate noise in the collected dataset and blur the perception of the user as a set of behaviours that the platform has.
* Where platform logic centralises, *bot logic* fragments * Where platform logic centralises, *bot logic* fragments
Platforms such as Twitter or Facebook are built as centralized systems: the servers on which information is stored are owned by these companies. The servers are triggering the need for immensive datacenter infrastructures throughout the world. Bots, on the other hand, do not require a lot of computational power in order to run. They can be simply executed from the computers of the bot-makers themselves. In fact, bots really point to the materiality of the systems on which they run, as researcher Stuart Geiger also points out when he talks about *bespoke code*: Platforms such as Twitter or Facebook are built as centralized systems: the servers on which information is stored are owned by these companies. The servers are triggering the need for growing data center infrastructures throughout the world. Bots, on the other hand, do not require a lot of computational power in order to run. They can be simply executed from the computers of the bot makers themselves. In fact, bots really point to the materiality of the systems on which they run, as researcher Stuart Geiger also points out when he talks about *bespoke code*:
> [code that] runs on top of or alongside existing systems instead of being more directly integrated into and run on software-side codebases[^geiger]. > [code that] runs on top of or alongside existing systems instead of being more directly integrated into and run on software-side codebases[^geiger].
@ -37,24 +37,22 @@ If we think about a commercial platform as a structure or surface on which actio
--------- ---------
[mb: i think that this section on the Fediverse can work well on a next page, for example under the title "centralized vs. federated networks"] The *bot logic* arguments were written with centralised platforms in mind, however, exciting developments are happening on federated platforms such as Mastodon, where users are part of defining features and possibilities of interaction.
All of the *bot logic* points were written with commercial platforms in mind, however, exciting developments are happening in federated platforms such as Mastodon, where users are part of defining features and possibilities of interaction.
To understand how Mastodon operates differently, it is useful to look at two examples of communication platforms that employ different network topologies and governance models: Twitter (centralised) and Mastodon (decentralised, federated)[^mastodon]. Both microblogging platforms Twitter and Mastodon have a significant amount of bot agents. To understand how Mastodon operates differently, it is useful to look at two examples of communication platforms that employ different network topologies and governance models: Twitter (centralised) and Mastodon (decentralised, federated)[^mastodon]. Both microblogging platforms Twitter and Mastodon have a significant amount of bot agents.
How do these bots relate to their computational infrastructures *differently*? How does the way in which these bots relate to their computational infrastructures *differ*?
As opposed to Twitter, Mastodon is a free and open source self-hosted networking service. Anyone can become a node in the network by installing the software and thus federate with other servers. The nodes, or user bases, are referred to as "instances" which have community-determined norms. There, the norms of the platform and the way they are codified into the technical structure are more often revised and reformulated together with the people using the platform, such as a Code of Conduct. As opposed to Twitter, Mastodon is a free and open source self-hosted networking service. Anyone can become a node in the network by installing the software and thus federate with other servers. The nodes, or user bases, are referred to as "instances" which have community-determined norms. There, the norms of the platform and the way they are codified into the technical structure are more often revised and reformulated together with the people using the platform, such as a Code of Conduct.
Mastodon is part of a bigger network, which is also known as *the Fediverse*, which has grown into a social media space that is currently used by more then 5 million people. In contrast to social media platforms as Twitter, Instagram or Facebook, it consists of a whole range of different *kind of* social media: blogs, micro-blogging, photo-sharing, video-sharing, link-sharing, etc., that can exchange posts and content with each other. Each instance does this, however, under their own terms. In contrast with the top-down organisation of centralized networks, the Fediverse and its federated network typology allow different groups to configure their network differently. Mastodon is part of a bigger network, which is also known as *the Fediverse*, which has grown into a social media space that is currently used by more then 5 million people. In contrast to social media platforms as Twitter, Instagram or Facebook, it consists of a whole range of different *kind of* social media: blogs, micro-blogging, photo sharing, video sharing, link sharing, etc., that can exchange posts and content with each other. Each instance does this, however, under their own terms. In contrast with the top-down organisation of centralized networks, the Fediverse and its federated network typology allow different groups to configure their network differently.
Each network is being shaped by its stakeholders. Which is sometimes a single individual, sometimes a group of peers that share the same interest and other times by an organisation. Often it is the system administrator(s) of a network who decides what the rules are: who can publish? What kind of material can be published? What communication features are available? Each network is being shaped by its stakeholders. Which is sometimes a single individual, sometimes a group of peers that share the same interest and other times an organisation. Often it is the system administrator(s) of a network who decides what the rules are: Who can publish? What kind of material can be published? What communication features are available?
![*Giving social networking back to you*. From: <https://docs.joinmastodon.org/>](https://cdn-images-1.medium.com/max/3318/1*LG72b92ZTWP9Ki8eHYh7Rg.jpeg) ![*Giving social networking back to you*. From: <https://docs.joinmastodon.org/>](https://cdn-images-1.medium.com/max/3318/1*LG72b92ZTWP9Ki8eHYh7Rg.jpeg)
<!-- ![From left to right: Centralized, Federated, Distributed. From: <https://docs.joinmastodon.org/>](https://docs.joinmastodon.org/assets/image%20%289%29.png) --> <!-- ![From left to right: Centralized, Federated, Distributed. From: <https://docs.joinmastodon.org/>](https://docs.joinmastodon.org/assets/image%20%289%29.png) -->
Interestingly enough, with a different infrastructural system comes a different type of ruleset. The federated network structure of the Fediverse also has concequences for bots. On platforms like Mastodon, bots need to both comply to the terms of services of the API and to community agreements, such as the formentioned Code of Conduct or Community Guidelines. With a different infrastructural system comes a different type of rule set. The federated network structure of the Fediverse also has consequences for bots. On platforms like Mastodon, bots need to both comply to the terms of services of the API and to community agreements, such as the aforementioned Codes of Conduct or Community Guidelines.
<!-- , as Aymeric Mansoux and Roel Roscam Abbing have pointed out in their article *Seven Theses on the Fediverse and the Becoming of FLOSS*[^theses]. --> <!-- , as Aymeric Mansoux and Roel Roscam Abbing have pointed out in their article *Seven Theses on the Fediverse and the Becoming of FLOSS*[^theses]. -->
<!-- [mb: insert quote from A & R here? Now we only mention the text.] --> <!-- [mb: insert quote from A & R here? Now we only mention the text.] -->

24
content/Section 4 - Bot Logic/3-examples.md

@ -11,13 +11,29 @@ In 2016, Darius Kazemi, a computer programmer and artist, made staywokebot[^stay
------------ ------------
**Parliament edits** **Parliament Wikiedits**
... One of the guidelines of English Wikipedia is to avoid conflicts of interest by not writing about yourself, family, friends, clients, employers, or your financial and other relationships.
If you edit on Wikipedia without making an account, your IP address will be made public. Journalist and developer Tom Scott made use this situation to make Parliament Wikiedits[^wikiedits], a bot that will look at recent edits on the British Parliament made by anonymous users and retweet the ones that were made in the IP address range belonging to the British Parliament.
The bot was resurrected by Ed Summers in 2014, after the IP addresses had been intentionally modified following a rejected Freedom of Information Request. Summers made the code available on Github[^anon] and instructed how users could modify the IP addresses and make their own bot. This inspired multiple other iterations, among which the most well-known one is congress-editors[^congress].
It turned out that most edits made by these IP addresses were fixing punctuation, spelling or grammar. Nonetheless, they sparked the imagination of many others which installed their own instance of the bot to patrol their national governments.
------------
**OCRbot**
OCRbot[^ocr] is a bot made for Mastodon, which responds to users calling who call it. It is used to run OCR (Optical Character Recognition) on images containing text and it is an especially helpful feature for generated captions for vision impaired people. This example of a bot shows how users can alter the functionalities of a platform through a bot. Where there is a lack in the Mastodon interface, this bot can be used to supplement it and in this way increase the accessibility of the site. The code for this bot is available of Github[^ocrcode].
**OCR bots**
...
# Footnotes # Footnotes
[^staywoke]: StayWokeBot <https://twitter.com/StayWokeBot/> [^staywoke]: StayWokeBot <https://twitter.com/StayWokeBot/>
[^wikiedits]: Parliament Wikiedits bot <https://twitter.com/parliamentedits>
[^anon]: Github code for the Parliament Wikiedits bot <https://github.com/edsu/anon>
[^congress]: Congress-editors bot <https://twitter.com/congresseditors?lang=en>
[^ocr]: OCRbot's replies <https://fedi.lynnesbian.space/@OCRbot/with_replies>
[^ocrcode]: Github code of OCRbot <https://github.com/Lynnesbian/OCRbot>

23
content/Section 4 - Bot Logic/4-bot-behaviour.md

@ -7,22 +7,23 @@ As programmable objects bots have particular *action modes*.
Below some examples (although this is a non-exhaustive list). Below some examples (although this is a non-exhaustive list).
- *repetition*: bots can be run repeatedly - *repetition*: bots can be run repeatedly,
- *condition*: bots are often written in response to a particular condition - *condition*: bots are often written in response to a particular condition,
- *iteration*: bots can be used multiple times - *iteration*: bots can be used multiple times,
- *memory*: bots can rely on a database - *memory*: bots can rely on a database,
- *tempo*: bots can operate at a specific time frame as described by the programmer - *tempo*: bots can operate at a specific time frame as described by the programmer,
- *versioning*: bots can make multiple versions of an original source - *versioning*: bots can make multiple versions of an original source,
- *amplification*: bots can extend the reach of a message - *amplification*: bots can extend the reach of a message.
Of course, these action modes can also be executed by humans. Of course, these action modes can also be executed by people.
It is by no means surprising that many Twitter users are mistaken for bots, or that the term itself has attained a derogatory meaning. However, an interesting phenomenon can be observed on platforms such as Twitter, where human users have adopted a type of bot behaviour to create networks of dissent and to push activist counter-narratives. It is by no means surprising that many Twitter users are mistaken for bots, or that the term itself has attained a derogatory meaning. However, an interesting phenomenon can be observed on platforms such as Twitter, where human users have adopted a type of bot behaviour to create networks of dissent and to push activist counter-narratives.
Such a moment happened recently on Dutch Twitter. In response to the Black Lives Matter protests, extreme right wing politician Geert Wilders posted an image on Twitter on June 5th 2020 using the hashtag #ZwartePietMatters.[^zwartepiet] Following this post, a wave of ... from the k-pop community ... [mb: expand] Such a moment happened recently on Dutch Twitter. In response to the Black Lives Matter protests, extreme right wing politician Geert Wilders posted an image on Twitter on June 5th 2020 using the hashtag #ZwartePietMatters.[^zwartepiet] Following this post, a wave of fancam[^fanpic] users from the k-pop community have flooded the hashtag with video recordings of their favourite k-pop stars, making the thread difficult to follow. This is becoming a common phenomenon across the Twitterscape, where fancams are used not only for praising musicians, but instead for derailing and hijacking hashtags these users consider unacceptable.
[mb: do we want to add one more page, in which we conclude how *bot logic* is useful as a term?] Fancam users display an intimate understanding of the platform, so much so that they manually generate noise through collective interventions in various topics. The repetitiveness of their attacks and the high amount thereof clog the thread interface, thus altering its functionality. In this sense, human user interventions can also be phrased as bot logic being applied.
## Footnotes ## Footnotes
[^zwartepiet]: Zwarte Piet is a ... [^zwartepiet]: According to Dutch folklore, Zwarte Piet is the companion of Sinterklaas. When performed, the character is represented through anti-Black imagery: blackface, curly wigs, bright red lipstick. Black activist groups in The Netherlands have been campaigning for the delegitimisation of this character for many years.
[^fanpic]: Fancam is footage focusing on a single member of a band, usually while the group is performing. It can also be used for solo artists.

247
content/bot-example/mastodon-bot-ccl.ipynb

@ -0,0 +1,247 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Mastodon bot Example"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This Mastodon bot example is part of the module *Bots as Infrapuncture*. :-)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"(explain a bit how Jupyter notebooks work)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"!{sys.executable} -m pip install Mastodon.py"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"from mastodon import Mastodon # https://github.com/halcy/Mastodon.py"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"instance = 'https://botsin.space'\n",
"# username = 'USERNAME'\n",
"# password = 'PASSWORD'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Register the bot as an application, save details as a (.secret) plain text file.\n",
"\n",
"# This only needs to be done once!\n",
"# (we already did it)\n",
"\n",
"# Mastodon.create_app(\n",
"# 'bots-as-infrapunctures',\n",
"# api_base_url = instance,\n",
"# to_file = 'mastodon-bot.secret'\n",
"# )"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Write your login details to a (.secret) plain text file.\n",
"\n",
"# This only needs to be done once!\n",
"# (we already did it)\n",
"\n",
"# mastodon = Mastodon(\n",
"# client_id = 'mastodon-bot.secret',\n",
"# api_base_url = instance\n",
"# )\n",
"\n",
"# mastodon.log_in(\n",
"# username,\n",
"# password,\n",
"# to_file = 'mastodon-bot-usercred.secret'\n",
"# )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we will run the bot!!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Start up the bot....\n",
"\n",
"mastodon = Mastodon(\n",
" access_token = 'mastodon-bot-usercred.secret',\n",
" api_base_url = instance\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Start tooting!\n",
"\n",
"mastodon.toot('testing tooting')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Another one, automized over a longer period of time\n",
"\n",
"from time import sleep\n",
"\n",
"toots = [\n",
" 'Sentence 1',\n",
" 'Sentence 2',\n",
" 'Sentence 3',\n",
" 'Sentence 4',\n",
" 'Sentence 5'\n",
"]\n",
"\n",
"for toot in toots:\n",
" mastodon.toot(toot)\n",
" sleep(300) # 300 seconds = 5 minutes"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Something with a dictionary\n",
"\n",
"vocabulary = {\n",
" \n",
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Generate sentences ? \n",
"\n",
"names = ['', '', '']\n",
"objects = ['', '', '']\n",
"actions = ['', '', '']"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<method 'time' of 'datetime.datetime' objects>\n"
]
}
],
"source": [
"# Using the current time\n",
"\n",
"from datetime import datetime\n",
"\n",
"print(datetime.now)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading…
Cancel
Save