Browse Source

removing the output

master
manetta 4 years ago
parent
commit
48169242c1
  1. 173
      content/bot-example/mastodon-bot.ipynb

173
content/bot-example/mastodon-bot.ipynb

@ -46,28 +46,9 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: Mastodon.py in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (1.5.1)\n",
"Requirement already satisfied: python-magic in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (0.4.18)\n",
"Requirement already satisfied: requests>=2.4.2 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (2.24.0)\n",
"Requirement already satisfied: blurhash>=1.1.4 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (1.1.4)\n",
"Requirement already satisfied: decorator>=4.0.0 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (4.4.2)\n",
"Requirement already satisfied: python-dateutil in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (2.8.1)\n",
"Requirement already satisfied: six in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (1.15.0)\n",
"Requirement already satisfied: pytz in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from Mastodon.py) (2020.1)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from requests>=2.4.2->Mastodon.py) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from requests>=2.4.2->Mastodon.py) (2020.6.20)\n",
"Requirement already satisfied: idna<3,>=2.5 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from requests>=2.4.2->Mastodon.py) (2.10)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/ccl/Documents/bots-as-digital-infrapunctures/bots-venv/lib/python3.7/site-packages (from requests>=2.4.2->Mastodon.py) (1.25.10)\n"
]
}
],
"outputs": [],
"source": [
"import sys\n",
"!{sys.executable} -m pip install Mastodon.py"
@ -75,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -98,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -121,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@ -151,67 +132,9 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 105197319551754193,\n",
" 'created_at': datetime.datetime(2020, 11, 12, 12, 21, 48, 992000, tzinfo=tzutc()),\n",
" 'in_reply_to_id': None,\n",
" 'in_reply_to_account_id': None,\n",
" 'sensitive': False,\n",
" 'spoiler_text': '',\n",
" 'visibility': 'public',\n",
" 'language': 'en',\n",
" 'uri': 'https://botsin.space/users/infrapunctures/statuses/105197319551754193',\n",
" 'url': 'https://botsin.space/@infrapunctures/105197319551754193',\n",
" 'replies_count': 0,\n",
" 'reblogs_count': 0,\n",
" 'favourites_count': 0,\n",
" 'favourited': False,\n",
" 'reblogged': False,\n",
" 'muted': False,\n",
" 'bookmarked': False,\n",
" 'pinned': False,\n",
" 'content': '<p>testing tooting</p>',\n",
" 'reblog': None,\n",
" 'application': {'name': 'bots-as-infrapunctures', 'website': None},\n",
" 'account': {'id': 259694,\n",
" 'username': 'infrapunctures',\n",
" 'acct': 'infrapunctures',\n",
" 'display_name': '',\n",
" 'locked': False,\n",
" 'bot': False,\n",
" 'discoverable': None,\n",
" 'group': False,\n",
" 'created_at': datetime.datetime(2020, 10, 2, 12, 51, 39, 454000, tzinfo=tzutc()),\n",
" 'note': '<p></p>',\n",
" 'url': 'https://botsin.space/@infrapunctures',\n",
" 'avatar': 'https://botsin.space/avatars/original/missing.png',\n",
" 'avatar_static': 'https://botsin.space/avatars/original/missing.png',\n",
" 'header': 'https://botsin.space/headers/original/missing.png',\n",
" 'header_static': 'https://botsin.space/headers/original/missing.png',\n",
" 'followers_count': 2,\n",
" 'following_count': 1,\n",
" 'statuses_count': 6,\n",
" 'last_status_at': datetime.datetime(2020, 11, 12, 0, 0),\n",
" 'emojis': [],\n",
" 'fields': []},\n",
" 'media_attachments': [],\n",
" 'mentions': [],\n",
" 'tags': [],\n",
" 'emojis': [],\n",
" 'card': None,\n",
" 'poll': None}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"mastodon.toot('testing tooting')"
]
@ -225,21 +148,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'mastodon' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-53a6b322c1fc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mtoot\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtoots\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 12\u001b[0;31m \u001b[0mmastodon\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtoot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoot\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 13\u001b[0m \u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m300\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# 300 seconds = 5 minutes\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'mastodon' is not defined"
]
}
],
"outputs": [],
"source": [
"from time import sleep\n",
"\n",
@ -265,67 +176,9 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 105197369852935060,\n",
" 'created_at': datetime.datetime(2020, 11, 12, 12, 34, 36, 549000, tzinfo=tzutc()),\n",
" 'in_reply_to_id': None,\n",
" 'in_reply_to_account_id': None,\n",
" 'sensitive': False,\n",
" 'spoiler_text': '',\n",
" 'visibility': 'public',\n",
" 'language': 'en',\n",
" 'uri': 'https://botsin.space/users/infrapunctures/statuses/105197369852935060',\n",
" 'url': 'https://botsin.space/@infrapunctures/105197369852935060',\n",
" 'replies_count': 0,\n",
" 'reblogs_count': 0,\n",
" 'favourites_count': 0,\n",
" 'favourited': False,\n",
" 'reblogged': False,\n",
" 'muted': False,\n",
" 'bookmarked': False,\n",
" 'pinned': False,\n",
" 'content': '<p>Rosa likes lychees</p>',\n",
" 'reblog': None,\n",
" 'application': {'name': 'bots-as-infrapunctures', 'website': None},\n",
" 'account': {'id': 259694,\n",
" 'username': 'infrapunctures',\n",
" 'acct': 'infrapunctures',\n",
" 'display_name': '',\n",
" 'locked': False,\n",
" 'bot': False,\n",
" 'discoverable': None,\n",
" 'group': False,\n",
" 'created_at': datetime.datetime(2020, 10, 2, 12, 51, 39, 454000, tzinfo=tzutc()),\n",
" 'note': '<p></p>',\n",
" 'url': 'https://botsin.space/@infrapunctures',\n",
" 'avatar': 'https://botsin.space/avatars/original/missing.png',\n",
" 'avatar_static': 'https://botsin.space/avatars/original/missing.png',\n",
" 'header': 'https://botsin.space/headers/original/missing.png',\n",
" 'header_static': 'https://botsin.space/headers/original/missing.png',\n",
" 'followers_count': 2,\n",
" 'following_count': 1,\n",
" 'statuses_count': 8,\n",
" 'last_status_at': datetime.datetime(2020, 11, 12, 0, 0),\n",
" 'emojis': [],\n",
" 'fields': []},\n",
" 'media_attachments': [],\n",
" 'mentions': [],\n",
" 'tags': [],\n",
" 'emojis': [],\n",
" 'card': None,\n",
" 'poll': None}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import random\n",
"\n",
@ -340,7 +193,7 @@
"separator = ' '\n",
"\n",
"ourtoot = n + separator + a + separator + o\n",
"mastodon.toot(ourtoot)\n"
"mastodon.toot(ourtoot)"
]
},
{
@ -354,7 +207,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [

Loading…
Cancel
Save