Committed version 3 of the bot from the source code on my computer. Older versions of the bot were version controlled manually before I knew how to use Git.
This commit is contained in:
parent
eae07b923d
commit
2f10edc3f9
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
|||||||
|
# ---> VSCode
|
||||||
|
.vscode/
|
||||||
|
|
||||||
# ---> Python
|
# ---> Python
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
15
Pipfile
Normal file
15
Pipfile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[[source]]
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
name = "pypi"
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
nltk = "*"
|
||||||
|
numpy = "*"
|
||||||
|
syllables = "*"
|
||||||
|
python-dotenv = "*"
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
python_version = "3.9"
|
144
Pipfile.lock
generated
Normal file
144
Pipfile.lock
generated
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "eb33134165589c2fac76e4ae3a04ff96c7440d582630d9ec4a8daa482102bd14"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {
|
||||||
|
"python_version": "3.9"
|
||||||
|
},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"click": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a",
|
||||||
|
"sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
|
||||||
|
"version": "==7.1.2"
|
||||||
|
},
|
||||||
|
"joblib": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:9c17567692206d2f3fb9ecf5e991084254fe631665c450b443761c4186a613f7",
|
||||||
|
"sha256:feeb1ec69c4d45129954f1b7034954241eedfd6ba39b5e9e4b6883be3332d5e5"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '3.6'",
|
||||||
|
"version": "==1.0.1"
|
||||||
|
},
|
||||||
|
"nltk": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:845365449cd8c5f9731f7cb9f8bd6fd0767553b9d53af9eb1b3abf7700936b35"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==3.5"
|
||||||
|
},
|
||||||
|
"numpy": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:032be656d89bbf786d743fee11d01ef318b0781281241997558fa7950028dd29",
|
||||||
|
"sha256:104f5e90b143dbf298361a99ac1af4cf59131218a045ebf4ee5990b83cff5fab",
|
||||||
|
"sha256:125a0e10ddd99a874fd357bfa1b636cd58deb78ba4a30b5ddb09f645c3512e04",
|
||||||
|
"sha256:12e4ba5c6420917571f1a5becc9338abbde71dd811ce40b37ba62dec7b39af6d",
|
||||||
|
"sha256:13adf545732bb23a796914fe5f891a12bd74cf3d2986eed7b7eba2941eea1590",
|
||||||
|
"sha256:2d7e27442599104ee08f4faed56bb87c55f8b10a5494ac2ead5c98a4b289e61f",
|
||||||
|
"sha256:3bc63486a870294683980d76ec1e3efc786295ae00128f9ea38e2c6e74d5a60a",
|
||||||
|
"sha256:3d3087e24e354c18fb35c454026af3ed8997cfd4997765266897c68d724e4845",
|
||||||
|
"sha256:4ed8e96dc146e12c1c5cdd6fb9fd0757f2ba66048bf94c5126b7efebd12d0090",
|
||||||
|
"sha256:60759ab15c94dd0e1ed88241fd4fa3312db4e91d2c8f5a2d4cf3863fad83d65b",
|
||||||
|
"sha256:65410c7f4398a0047eea5cca9b74009ea61178efd78d1be9847fac1d6716ec1e",
|
||||||
|
"sha256:66b467adfcf628f66ea4ac6430ded0614f5cc06ba530d09571ea404789064adc",
|
||||||
|
"sha256:7199109fa46277be503393be9250b983f325880766f847885607d9b13848f257",
|
||||||
|
"sha256:72251e43ac426ff98ea802a931922c79b8d7596480300eb9f1b1e45e0543571e",
|
||||||
|
"sha256:89e5336f2bec0c726ac7e7cdae181b325a9c0ee24e604704ed830d241c5e47ff",
|
||||||
|
"sha256:89f937b13b8dd17b0099c7c2e22066883c86ca1575a975f754babc8fbf8d69a9",
|
||||||
|
"sha256:9c94cab5054bad82a70b2e77741271790304651d584e2cdfe2041488e753863b",
|
||||||
|
"sha256:9eb551d122fadca7774b97db8a112b77231dcccda8e91a5bc99e79890797175e",
|
||||||
|
"sha256:a1d7995d1023335e67fb070b2fae6f5968f5be3802b15ad6d79d81ecaa014fe0",
|
||||||
|
"sha256:ae61f02b84a0211abb56462a3b6cd1e7ec39d466d3160eb4e1da8bf6717cdbeb",
|
||||||
|
"sha256:b9410c0b6fed4a22554f072a86c361e417f0258838957b78bd063bde2c7f841f",
|
||||||
|
"sha256:c26287dfc888cf1e65181f39ea75e11f42ffc4f4529e5bd19add57ad458996e2",
|
||||||
|
"sha256:c91ec9569facd4757ade0888371eced2ecf49e7982ce5634cc2cf4e7331a4b14",
|
||||||
|
"sha256:ecb5b74c702358cdc21268ff4c37f7466357871f53a30e6f84c686952bef16a9"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==1.20.1"
|
||||||
|
},
|
||||||
|
"python-dotenv": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e",
|
||||||
|
"sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==0.15.0"
|
||||||
|
},
|
||||||
|
"regex": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:07ef35301b4484bce843831e7039a84e19d8d33b3f8b2f9aab86c376813d0139",
|
||||||
|
"sha256:13f50969028e81765ed2a1c5fcfdc246c245cf8d47986d5172e82ab1a0c42ee5",
|
||||||
|
"sha256:14de88eda0976020528efc92d0a1f8830e2fb0de2ae6005a6fc4e062553031fa",
|
||||||
|
"sha256:159fac1a4731409c830d32913f13f68346d6b8e39650ed5d704a9ce2f9ef9cb3",
|
||||||
|
"sha256:18e25e0afe1cf0f62781a150c1454b2113785401ba285c745acf10c8ca8917df",
|
||||||
|
"sha256:201e2619a77b21a7780580ab7b5ce43835e242d3e20fef50f66a8df0542e437f",
|
||||||
|
"sha256:360a01b5fa2ad35b3113ae0c07fb544ad180603fa3b1f074f52d98c1096fa15e",
|
||||||
|
"sha256:39c44532d0e4f1639a89e52355b949573e1e2c5116106a395642cbbae0ff9bcd",
|
||||||
|
"sha256:3d9356add82cff75413bec360c1eca3e58db4a9f5dafa1f19650958a81e3249d",
|
||||||
|
"sha256:3d9a7e215e02bd7646a91fb8bcba30bc55fd42a719d6b35cf80e5bae31d9134e",
|
||||||
|
"sha256:4651f839dbde0816798e698626af6a2469eee6d9964824bb5386091255a1694f",
|
||||||
|
"sha256:486a5f8e11e1f5bbfcad87f7c7745eb14796642323e7e1829a331f87a713daaa",
|
||||||
|
"sha256:4b8a1fb724904139149a43e172850f35aa6ea97fb0545244dc0b805e0154ed68",
|
||||||
|
"sha256:4c0788010a93ace8a174d73e7c6c9d3e6e3b7ad99a453c8ee8c975ddd9965643",
|
||||||
|
"sha256:4c2e364491406b7888c2ad4428245fc56c327e34a5dfe58fd40df272b3c3dab3",
|
||||||
|
"sha256:575a832e09d237ae5fedb825a7a5bc6a116090dd57d6417d4f3b75121c73e3be",
|
||||||
|
"sha256:5770a51180d85ea468234bc7987f5597803a4c3d7463e7323322fe4a1b181578",
|
||||||
|
"sha256:633497504e2a485a70a3268d4fc403fe3063a50a50eed1039083e9471ad0101c",
|
||||||
|
"sha256:63f3ca8451e5ff7133ffbec9eda641aeab2001be1a01878990f6c87e3c44b9d5",
|
||||||
|
"sha256:709f65bb2fa9825f09892617d01246002097f8f9b6dde8d1bb4083cf554701ba",
|
||||||
|
"sha256:808404898e9a765e4058bf3d7607d0629000e0a14a6782ccbb089296b76fa8fe",
|
||||||
|
"sha256:882f53afe31ef0425b405a3f601c0009b44206ea7f55ee1c606aad3cc213a52c",
|
||||||
|
"sha256:8bd4f91f3fb1c9b1380d6894bd5b4a519409135bec14c0c80151e58394a4e88a",
|
||||||
|
"sha256:8e65e3e4c6feadf6770e2ad89ad3deb524bcb03d8dc679f381d0568c024e0deb",
|
||||||
|
"sha256:976a54d44fd043d958a69b18705a910a8376196c6b6ee5f2596ffc11bff4420d",
|
||||||
|
"sha256:a0d04128e005142260de3733591ddf476e4902c0c23c1af237d9acf3c96e1b38",
|
||||||
|
"sha256:a0df9a0ad2aad49ea3c7f65edd2ffb3d5c59589b85992a6006354f6fb109bb18",
|
||||||
|
"sha256:a2ee026f4156789df8644d23ef423e6194fad0bc53575534101bb1de5d67e8ce",
|
||||||
|
"sha256:a59a2ee329b3de764b21495d78c92ab00b4ea79acef0f7ae8c1067f773570afa",
|
||||||
|
"sha256:b97ec5d299c10d96617cc851b2e0f81ba5d9d6248413cd374ef7f3a8871ee4a6",
|
||||||
|
"sha256:b98bc9db003f1079caf07b610377ed1ac2e2c11acc2bea4892e28cc5b509d8d5",
|
||||||
|
"sha256:b9d8d286c53fe0cbc6d20bf3d583cabcd1499d89034524e3b94c93a5ab85ca90",
|
||||||
|
"sha256:bcd945175c29a672f13fce13a11893556cd440e37c1b643d6eeab1988c8b209c",
|
||||||
|
"sha256:c66221e947d7207457f8b6f42b12f613b09efa9669f65a587a2a71f6a0e4d106",
|
||||||
|
"sha256:c782da0e45aff131f0bed6e66fbcfa589ff2862fc719b83a88640daa01a5aff7",
|
||||||
|
"sha256:cb4ee827857a5ad9b8ae34d3c8cc51151cb4a3fe082c12ec20ec73e63cc7c6f0",
|
||||||
|
"sha256:d47d359545b0ccad29d572ecd52c9da945de7cd6cf9c0cfcb0269f76d3555689",
|
||||||
|
"sha256:dc9963aacb7da5177e40874585d7407c0f93fb9d7518ec58b86e562f633f36cd",
|
||||||
|
"sha256:ea2f41445852c660ba7c3ebf7d70b3779b20d9ca8ba54485a17740db49f46932",
|
||||||
|
"sha256:f5d0c921c99297354cecc5a416ee4280bd3f20fd81b9fb671ca6be71499c3fdf",
|
||||||
|
"sha256:f85d6f41e34f6a2d1607e312820971872944f1661a73d33e1e82d35ea3305e14"
|
||||||
|
],
|
||||||
|
"version": "==2021.3.17"
|
||||||
|
},
|
||||||
|
"syllables": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:4d65e542db97927ccce04f6668bda528f29f346bf7f5d8524c436eabae8a4cd6",
|
||||||
|
"sha256:66718d775b607e2c73f87ce2f6a652daf7c701c4ca8fd1c807b544d4f6bda28b"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==0.1.0"
|
||||||
|
},
|
||||||
|
"tqdm": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:9fdf349068d047d4cfbe24862c425883af1db29bcddf4b0eeb2524f6fbdb23c7",
|
||||||
|
"sha256:d666ae29164da3e517fcf125e41d4fe96e5bb375cd87ff9763f6b38b5592fe33"
|
||||||
|
],
|
||||||
|
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||||
|
"version": "==4.59.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"develop": {}
|
||||||
|
}
|
82
README.md
82
README.md
@ -1,3 +1,81 @@
|
|||||||
# vision-bot
|
# Vision Bot
|
||||||
|
|
||||||
Twitter bot that posts randomly generated Vision quotes and interacts with other people saying 'what is x if not y persevering'.
|
This is a Twitter bot that posts randomly generated Vision quotes and interacts with other people saying 'what is x if not y persevering'.
|
||||||
|
|
||||||
|
The bot is available on Twitter [@BotPersevering](https://twitter.com/BotPersevering).
|
||||||
|
|
||||||
|
This is a silly bot intended to parody a line of dialogue that got a lot of attention and fame, and is just a fun piece of code.
|
||||||
|
|
||||||
|
## Bot Structure
|
||||||
|
The bot has two functions:
|
||||||
|
1. A posting function that posts a quote in the format of 'What is x, if not y persevering?' at the top of each hour, and
|
||||||
|
2. An interaction function that likes and retweets any tweets it finds matching that format every five minutes.
|
||||||
|
|
||||||
|
Each function is a self-contained programme that authenticates to the bot independently using the same API tokens.
|
||||||
|
They are both contained in separate Docker containers that are then spun up using docker-compose.
|
||||||
|
Both Docker images are based on the Python image.
|
||||||
|
|
||||||
|
### Posting Function
|
||||||
|
The posting function is fairly straightforward.
|
||||||
|
The bot has set lists of phrases categorised by number of syllables.
|
||||||
|
These lists were built using various natural language libraries in python, and may not be the most reliable dataset.
|
||||||
|
|
||||||
|
At the top of its posting cycle, it randomly determines how many syllables the phrases it will use will have, and it uses phrases of the same number of syllables on either side so that the quote scans well.
|
||||||
|
It randomly selects a phrase from the corresponding word list.
|
||||||
|
|
||||||
|
After it selects the first phrase, it selects the second phrase using the following algorithm:
|
||||||
|
1. Select a random phrase,
|
||||||
|
2. If it is the same phrase as the first, discard and select a new phrase,
|
||||||
|
3. Check the phrase's similarity score, using some rudimentary natural language processing, to the first phrase,
|
||||||
|
4. If it less than a 66% similarity (which is roughly equal to the similarity score between 'grief' and 'love' which was the original basis of the quote), discard and try selecting a new phrase up to five times,
|
||||||
|
5. If this is the fifth time the bot is attempting to find a phrase of adequate similarity and it is still unable to do so, then disregard the similarity scores,
|
||||||
|
6. Once it has selected a phrase that matches the similarity requirement, or it has tried at least five times and failed, it will post the two phrases in the format 'What is `<phrase 1>` if not `<phrase 2>` persevering?', and
|
||||||
|
7. After it has posted the tweet, it logs the post and waits until the next hour.
|
||||||
|
|
||||||
|
### Interaction Function
|
||||||
|
The Interaction function is much simpler.
|
||||||
|
Every five minutes, it searches the Twitter timeline for quotes that fit the format `What is <phrase 1> if not <phrase 2> persevering?`.
|
||||||
|
It parses a list of all of these tweets, and likes and re-tweets all of them that were later than the last tweet it interacted with.
|
||||||
|
It then logs the most recent tweet as the most recent tweet it interacted with so that it remembers a starting point for the next time it parses tweets.
|
||||||
|
|
||||||
|
### `development` Directory
|
||||||
|
This directory contains code and word lists that I had used to generate the bot's word lists.
|
||||||
|
It is all fairly rudimentary code to spit out text files that have lists of words categorised by syllables.
|
||||||
|
These lists formed the basis for the word lists the bot uses.
|
||||||
|
I deleted some of the more un-funny ones, like a lot of phrases that were '... currency unit', amongst others.
|
||||||
|
This has no bearing on the actual functioning of the bot.
|
||||||
|
I have just left this here on the off chance people need to re-generate the word lists.
|
||||||
|
|
||||||
|
In order to re-generate word lists, simply run the Python scripts.
|
||||||
|
This has no connection to the Docker containers or any of the other set-up for the bot.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
Running another instance of the Bot is very straightforward.
|
||||||
|
As the entire bot is Dockerised and uses Docker Compose, all you need to do is:
|
||||||
|
1. Clone the repository,
|
||||||
|
2. Create a `.env` file in the main directory, as well as in the `/interaction` and `/posting` directories that contain the various API keys (using the template below),
|
||||||
|
3. Install and run Docker and Docker Compose, and
|
||||||
|
4. Navigate to the folder containing the `docker-compose.yml` file and use the command `sudo docker-compose up -d`.
|
||||||
|
|
||||||
|
## `.env` File
|
||||||
|
I have kept all of my API keys private and on `.env` files that Docker ignores when pushing to the repository.
|
||||||
|
You will need to create your own `.env` files to store these values, and have multiple copies of this in the same directory as the `docker-compose.yml` file, and the `/interaction` and `/posting` directories.
|
||||||
|
|
||||||
|
**N.B.**: Make sure you use the same variable names as below.
|
||||||
|
|
||||||
|
`.env` file(s):
|
||||||
|
|
||||||
|
```
|
||||||
|
BOT_VERSION=3.0
|
||||||
|
BEARER_TOKEN=
|
||||||
|
ACCESS_TOKEN=
|
||||||
|
ACCESS_TOKEN_SECRET=
|
||||||
|
API_TOKEN=
|
||||||
|
API_KEY_SECRET=
|
||||||
|
```
|
||||||
|
## Version History
|
||||||
|
This is the third version of the bot, and I made the first two before I learnt how to use Docker, so my version control for that is messy and all over the shop.
|
||||||
|
|
||||||
|
The third version added the natural language processing, had a massively expanded list of words, and basically did everything that I learnt the bot could do after I realised there were natural language processing libraries on Python.
|
||||||
|
***
|
||||||
|
My thanks to Alan Jackson for his valuable suggestions for this project.
|
157
development/10_syllable.txt
Normal file
157
development/10_syllable.txt
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
large indefinite quantity
|
||||||
|
imaginative comparison
|
||||||
|
coordinated universal time
|
||||||
|
application-oriented language
|
||||||
|
histocompatibility complex
|
||||||
|
nongovernmental organization
|
||||||
|
command processing overhead time
|
||||||
|
X-linked dominant inheritance
|
||||||
|
negative identification
|
||||||
|
positive identification
|
||||||
|
National Association of Realtors
|
||||||
|
Democratic-Republican Party
|
||||||
|
magnetomotive force unit
|
||||||
|
Argentine monetary unit
|
||||||
|
Bangladeshi monetary unit
|
||||||
|
Belarusian monetary unit
|
||||||
|
Bhutanese monetary unit
|
||||||
|
Cape Verde monetary unit
|
||||||
|
Costa Rican monetary unit
|
||||||
|
Dominican monetary unit
|
||||||
|
Ecuadoran monetary unit
|
||||||
|
Guatemalan monetary unit
|
||||||
|
Guinea-Bissau monetary unit
|
||||||
|
Icelandic monetary unit
|
||||||
|
Indonesian monetary unit
|
||||||
|
Japanese monetary unit
|
||||||
|
Kazakhstani monetary unit
|
||||||
|
Kyrgyzstani monetary unit
|
||||||
|
Lebanese monetary unit
|
||||||
|
Mauritanian monetary unit
|
||||||
|
Mozambique monetary unit
|
||||||
|
Nepalese monetary unit
|
||||||
|
Nicaraguan monetary unit
|
||||||
|
Pakistani monetary unit
|
||||||
|
Panamanian monetary unit
|
||||||
|
Philippine monetary unit
|
||||||
|
Portuguese monetary unit
|
||||||
|
Sierra Leone monetary unit
|
||||||
|
South African monetary unit
|
||||||
|
Sudanese monetary unit
|
||||||
|
Venezuelan monetary unit
|
||||||
|
Vietnamese monetary unit
|
||||||
|
Western Samoan monetary unit
|
||||||
|
Yugoslavian monetary unit
|
||||||
|
Revolutionary calendar month
|
||||||
|
reduced instruction set computing
|
||||||
|
hypothetical imperative
|
||||||
|
International Wanted Notice
|
||||||
|
suborder Pachycephalosaurus
|
||||||
|
Streptococcus anhemolyticus
|
||||||
|
International Court of Justice
|
||||||
|
combination in restraint of trade
|
||||||
|
Commonwealth of Independent States
|
||||||
|
National Academy of Sciences
|
||||||
|
reticular activating system
|
||||||
|
negative reinforcing stimulus
|
||||||
|
positive reinforcing stimulus
|
||||||
|
Dewey decimal classification
|
||||||
|
extracurricular activity
|
||||||
|
comprehensive examination
|
||||||
|
preliminary examination
|
||||||
|
biological warfare defense
|
||||||
|
trustee-beneficiary relation
|
||||||
|
amyotrophic lateral sclerosis
|
||||||
|
categorical imperative
|
||||||
|
machine readable dictionary
|
||||||
|
Master of Arts in Library Science
|
||||||
|
Master of Science in Engineering
|
||||||
|
declaration of estimated tax
|
||||||
|
database management system
|
||||||
|
Church of Jesus Christ of Latter-Day Saints
|
||||||
|
Evangelical and Reformed Church
|
||||||
|
Bureau of Justice Assistance
|
||||||
|
Federal Housing Administration
|
||||||
|
Financial Management Service
|
||||||
|
National Climatic Data Center
|
||||||
|
Naval Surface Warfare Center
|
||||||
|
Department of Justice Canada
|
||||||
|
Committee for State Security
|
||||||
|
International Monetary Fund
|
||||||
|
individual retirement account
|
||||||
|
rank-order correlation coefficient
|
||||||
|
maple syrup urine disease
|
||||||
|
standing operating procedure
|
||||||
|
health maintenance organization
|
||||||
|
hospitalization insurance
|
||||||
|
hyperbetalipoproteinemia
|
||||||
|
hypobetalipoproteinemia
|
||||||
|
Council of Economic Advisors
|
||||||
|
Central Intelligence Agency
|
||||||
|
Federal Protective Service
|
||||||
|
Interstate Commerce Commission
|
||||||
|
Nuclear Regulatory Commission
|
||||||
|
Office of Inspector General
|
||||||
|
United States Postal Service
|
||||||
|
Criminal Investigation Command
|
||||||
|
Drug Enforcement Administration
|
||||||
|
United States Marshals Service
|
||||||
|
Commission on the Status of Women
|
||||||
|
Foreign Intelligence Service
|
||||||
|
Secret Intelligence Service
|
||||||
|
National Security Agency
|
||||||
|
United States Secret Service
|
||||||
|
principle of liquid displacement
|
||||||
|
comparative literature
|
||||||
|
biserial correlation coefficient
|
||||||
|
multiple correlation coefficient
|
||||||
|
President of the United States
|
||||||
|
Secretary of Agriculture
|
||||||
|
Secretary of Veterans Affairs
|
||||||
|
magnetic resonance imaging
|
||||||
|
positron emission tomography
|
||||||
|
angiotensin converting enzyme
|
||||||
|
thyrotropin-releasing hormone
|
||||||
|
elephantiasis neuromatosa
|
||||||
|
major depressive episode
|
||||||
|
lower respiratory infection
|
||||||
|
upper respiratory infection
|
||||||
|
double standard of sexual behavior
|
||||||
|
secondary sex characteristic
|
||||||
|
communications intelligence
|
||||||
|
cardiopulmonary exercise
|
||||||
|
follicle-stimulating hormone
|
||||||
|
human chorionic gonadotropin
|
||||||
|
gamma aminobutyric acid
|
||||||
|
discoid lupus erythematosus
|
||||||
|
autosomal dominant disease
|
||||||
|
necrotizing enterocolitis
|
||||||
|
pelvic inflammatory disease
|
||||||
|
respiratory distress syndrome
|
||||||
|
Argentine hemorrhagic fever
|
||||||
|
Crimea-Congo hemorrhagic fever
|
||||||
|
arteriosclerosis obliterans
|
||||||
|
modified radical mastectomy
|
||||||
|
hormone replacement therapy
|
||||||
|
indirect immunofluorescence
|
||||||
|
somatic cell nuclear transplantation
|
||||||
|
breach of the covenant of warranty
|
||||||
|
adenosine monophosphate
|
||||||
|
beta-hydroxybutyric acid
|
||||||
|
nonthrombocytopenic purpura
|
||||||
|
posterior subcapsular cataract
|
||||||
|
paroxysmal trepidant abasia
|
||||||
|
Department of Commerce and Labor
|
||||||
|
correctional rehabilitation
|
||||||
|
vocational rehabilitation
|
||||||
|
electroconvulsive therapy
|
||||||
|
monounsaturated fatty acid
|
||||||
|
polyunsaturated fatty acid
|
||||||
|
abdominal actinomycosis
|
||||||
|
diethylaminoethyl cellulose
|
||||||
|
very low density lipoprotein
|
||||||
|
plasma thromboplastin antecedent
|
||||||
|
lymphocytic choriomeningitis
|
||||||
|
erythema nodosum leprosum
|
||||||
|
acute lymphocytic leukemia
|
||||||
|
acute myelocytic leukemia
|
87
development/11_syllable.txt
Normal file
87
development/11_syllable.txt
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
United States Customary System
|
||||||
|
X-linked recessive inheritance
|
||||||
|
conditioned emotional response
|
||||||
|
object-oriented programming language
|
||||||
|
Association of Southeast Asian Nations
|
||||||
|
American Federation of Labor
|
||||||
|
Congress of Industrial Organizations
|
||||||
|
Azerbaijani monetary unit
|
||||||
|
El Salvadoran monetary unit
|
||||||
|
Saudi Arabian monetary unit
|
||||||
|
Surinamese monetary unit
|
||||||
|
Tajikistani monetary unit
|
||||||
|
Uzbekistani monetary unit
|
||||||
|
Systeme International d'Unites
|
||||||
|
certificate of incorporation
|
||||||
|
occupational safety and health act
|
||||||
|
Council of Basel-Ferrara-Florence
|
||||||
|
North Atlantic Treaty Organization
|
||||||
|
neonatal intensive care unit
|
||||||
|
Palestine National Authority
|
||||||
|
equivalent-binary-digit factor
|
||||||
|
United Arab Emirate dirham
|
||||||
|
hierarchical classification system
|
||||||
|
electronic counter-countermeasures
|
||||||
|
business interruption insurance
|
||||||
|
primary subtractive color for light
|
||||||
|
personal identification number
|
||||||
|
Bachelor of Arts in Library Science
|
||||||
|
Bachelor of Science in Engineering
|
||||||
|
Bureau of Diplomatic Security
|
||||||
|
Bureau of Intelligence and Research
|
||||||
|
Naval Underwater Warfare Center
|
||||||
|
Office of Intelligence Support
|
||||||
|
Office of Naval Intelligence
|
||||||
|
United States Public Health Service
|
||||||
|
familial hypercholesterolemia
|
||||||
|
Waterhouse-Friderichsen syndrome
|
||||||
|
cardiopulmonary resuscitation
|
||||||
|
oxidation-reduction indicator
|
||||||
|
dichlorodiphenyltrichloroethane
|
||||||
|
generalized anxiety disorder
|
||||||
|
obsessive-compulsive disorder
|
||||||
|
acute schizophrenic episode
|
||||||
|
cystic fibrosis transport regulator
|
||||||
|
Evangelical United Brethren Church
|
||||||
|
Council on Environmental Policy
|
||||||
|
Office of Management and Budget
|
||||||
|
Environmental Protection Agency
|
||||||
|
Federal Communications Commission
|
||||||
|
General Services Administration
|
||||||
|
Securities and Exchange Commission
|
||||||
|
Social Security Administration
|
||||||
|
Federal Bureau of Investigation
|
||||||
|
Financial Crimes Enforcement Network
|
||||||
|
National Institute of Justice
|
||||||
|
Economic Commission for Africa
|
||||||
|
Economic Commission for Europe
|
||||||
|
Central Intelligence Machinery
|
||||||
|
Iraqi Intelligence Service
|
||||||
|
Defense Intelligence Agency
|
||||||
|
National Reconnaissance Office
|
||||||
|
product-moment correlation coefficient
|
||||||
|
tetrachoric correlation coefficient
|
||||||
|
Secretary of Commerce and Labor
|
||||||
|
North American Free Trade Agreement
|
||||||
|
adrenocorticotropic hormone
|
||||||
|
sodium carboxymethyl cellulose
|
||||||
|
premature ventricular contraction
|
||||||
|
Eysenck Personality Inventory
|
||||||
|
United States Naval Academy
|
||||||
|
bovine spongiform encephalitis
|
||||||
|
autosomal recessive disease
|
||||||
|
congenital afibrinogenemia
|
||||||
|
freedom from cruel and unusual punishment
|
||||||
|
right to speedy and public trial by jury
|
||||||
|
radioactive iodine excretion test
|
||||||
|
radioactive iodine uptake test
|
||||||
|
laparoscopic cholecystectomy
|
||||||
|
deoxyadenosine monophosphate
|
||||||
|
deoxycytidine monophosphate
|
||||||
|
deoxyguanosine monophosphate
|
||||||
|
deoxythymidine monophosphate
|
||||||
|
systemic lupus erythematosus
|
||||||
|
Department of Health and Human Services
|
||||||
|
Department of Homeland Security
|
||||||
|
cervicofacial actinomycosis
|
||||||
|
nephrogenic diabetes insipidus
|
47
development/12_syllable.txt
Normal file
47
development/12_syllable.txt
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
erythrocyte sedimentation rate
|
||||||
|
National Socialist German Workers' Party
|
||||||
|
Calymmatobacterium granulomatis
|
||||||
|
Foreign Intelligence Surveillance Court
|
||||||
|
Organization of American States
|
||||||
|
depository financial institution
|
||||||
|
United Mine Workers of America
|
||||||
|
electronic warfare-support measures
|
||||||
|
Bachelor of Science in Architecture
|
||||||
|
Center for Disease Control and Prevention
|
||||||
|
Defense Information Systems Agency
|
||||||
|
Defense Technical Information Center
|
||||||
|
Department of Energy Intelligence
|
||||||
|
Economic and Social Council commission
|
||||||
|
Food and Agriculture Organization
|
||||||
|
General Agreement on Tariffs and Trade
|
||||||
|
International Finance Corporation
|
||||||
|
International Labor Organization
|
||||||
|
World Meteorological Organization
|
||||||
|
standard generalized markup language
|
||||||
|
antisocial personality disorder
|
||||||
|
hereditary cerebellar ataxia
|
||||||
|
self-report personality inventory
|
||||||
|
Foreign Intelligence Surveillance Act
|
||||||
|
face-amount certificate company
|
||||||
|
Bureau of Alcohol Tobacco and Firearms
|
||||||
|
Federal Law Enforcement Training Center
|
||||||
|
acute hemorrhagic encephalitis
|
||||||
|
Secretary of Health and Human Services
|
||||||
|
imitative electronic deception
|
||||||
|
simulative electronic deception
|
||||||
|
melanocyte-stimulating hormone
|
||||||
|
disease of the neuromuscular junction
|
||||||
|
hyperbilirubinemia of the newborn
|
||||||
|
United States Air Force Academy
|
||||||
|
vocational rehabilitation program
|
||||||
|
marital communications privilege
|
||||||
|
subacute bacterial endocarditis
|
||||||
|
digital communications technology
|
||||||
|
ovulation method of family planning
|
||||||
|
transurethral resection of the prostate
|
||||||
|
recombinant deoxyribonucleic acid
|
||||||
|
hepatolenticular degeneration
|
||||||
|
adult respiratory distress syndrome
|
||||||
|
freedom from involuntary servitude
|
||||||
|
port-access coronary bypass surgery
|
||||||
|
oculopharyngeal muscular dystrophy
|
39
development/13_syllable.txt
Normal file
39
development/13_syllable.txt
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
obsessive-compulsive personality
|
||||||
|
generally accepted accounting principles
|
||||||
|
Palestine Liberation Organization
|
||||||
|
Sao Thome e Principe monetary unit
|
||||||
|
musical instrument digital interface
|
||||||
|
Supreme Headquarters Allied Powers Europe
|
||||||
|
Academy of Television Arts and Sciences
|
||||||
|
nondepository financial institution
|
||||||
|
international law enforcement agency
|
||||||
|
confidential adviser-advisee relation
|
||||||
|
Defense Advanced Research Projects Agency
|
||||||
|
Marine Corps Intelligence Activity
|
||||||
|
National Technical Information Service
|
||||||
|
Naval Air Warfare Center Weapons Division
|
||||||
|
Patent and Trademark Office Database
|
||||||
|
Transportation Security Administration
|
||||||
|
United States Fish and Wildlife Service
|
||||||
|
United States Government Printing Office
|
||||||
|
international intelligence agency
|
||||||
|
United States intelligence agency
|
||||||
|
International Development Association
|
||||||
|
severe combined immunodeficiency
|
||||||
|
Federal Home Loan Mortgage Corporation
|
||||||
|
Federal National Mortgage Association
|
||||||
|
United States Trade Representative
|
||||||
|
United States Postal Inspection Service
|
||||||
|
Communications Security Establishment
|
||||||
|
manipulative electronic deception
|
||||||
|
African American Vernacular English
|
||||||
|
California Personality Inventory
|
||||||
|
Sixteen Personality Factor Questionnaire
|
||||||
|
United States Military Academy
|
||||||
|
subacute sclerosing panencephalitis
|
||||||
|
functional magnetic resonance imaging
|
||||||
|
glutamic oxalacetic transaminase
|
||||||
|
age-related macular degeneration
|
||||||
|
chronic obstructive pulmonary disease
|
||||||
|
Department of Health Education and Welfare
|
||||||
|
Department of Housing and Urban Development
|
22
development/14_syllable.txt
Normal file
22
development/14_syllable.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
transmission control protocol/internet protocol
|
||||||
|
Organization of Petroleum-Exporting Countries
|
||||||
|
Academy of Motion Picture Arts and Sciences
|
||||||
|
United States House of Representatives
|
||||||
|
Advanced Research and Development Activity
|
||||||
|
Ballistic Missile Defense Organization
|
||||||
|
Department of Defense Laboratory System
|
||||||
|
Immigration and Naturalization Service
|
||||||
|
National Geospatial-Intelligence Agency
|
||||||
|
International Atomic Energy Agency
|
||||||
|
International Maritime Organization
|
||||||
|
relational database management system
|
||||||
|
Federal Deposit Insurance Corporation
|
||||||
|
Federal Emergency Management Agency
|
||||||
|
National Archives and Records Administration
|
||||||
|
Economic Commission for Asia and the Far East
|
||||||
|
Economic Commission for Latin America
|
||||||
|
Security Intelligence Review Committee
|
||||||
|
Secretary of Health Education and Welfare
|
||||||
|
Secretary of Housing and Urban Development
|
||||||
|
laser-assisted in situ keratomileusis
|
||||||
|
severe acute respiratory syndrome
|
10
development/15_syllable.txt
Normal file
10
development/15_syllable.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
United Arab Emirate monetary unit
|
||||||
|
Defense Reutilization and Marketing Service
|
||||||
|
National Institute of Standards and Technology
|
||||||
|
Occupational Safety and Health Administration
|
||||||
|
International Civil Aviation Organization
|
||||||
|
object-oriented database management system
|
||||||
|
National Aeronautics and Space Administration
|
||||||
|
Canadian Security Intelligence Service
|
||||||
|
Criminal Intelligence Services of Canada
|
||||||
|
International Relations and Security Network
|
6
development/16_syllable.txt
Normal file
6
development/16_syllable.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Association for the Advancement of Retired Persons
|
||||||
|
National Oceanic and Atmospheric Administration
|
||||||
|
International Bank for Reconstruction and Development
|
||||||
|
Directorate for Inter-Services Intelligence
|
||||||
|
enzyme-linked-immunosorbent serologic assay
|
||||||
|
laser-assisted subepithelial keratomileusis
|
7
development/17_syllable.txt
Normal file
7
development/17_syllable.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
General Certificate of Secondary Education
|
||||||
|
American Standard Code for Information Interchange
|
||||||
|
Organization for the Prohibition of Chemical Weapons
|
||||||
|
United Nations Crime Prevention and Criminal Justice
|
||||||
|
Minnesota Multiphasic Personality Inventory
|
||||||
|
basal body temperature method of family planning
|
||||||
|
minimally invasive coronary bypass surgery
|
2
development/18_syllable.txt
Normal file
2
development/18_syllable.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Air Force Intelligence Surveillance and Reconnaissance
|
||||||
|
United Nations Office for Drug Control and Crime Prevention
|
1
development/22_syllable.txt
Normal file
1
development/22_syllable.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
United Nations Educational Scientific and Cultural Organization
|
1
development/23_syllable.txt
Normal file
1
development/23_syllable.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
American Federation of Labor and Congress of Industrial Organizations
|
1
development/24_syllable.txt
Normal file
1
development/24_syllable.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
blood-oxygenation level dependent functional magnetic resonance imaging
|
33
development/listGenerator.py
Normal file
33
development/listGenerator.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
from nltk.corpus import wordnet as wn
|
||||||
|
from syllables import estimate
|
||||||
|
|
||||||
|
# syns = wn.synsets("program")
|
||||||
|
# print(syns[0].name())
|
||||||
|
|
||||||
|
# grief = wn.synsets('grief')
|
||||||
|
# love = wn.synsets('love')
|
||||||
|
|
||||||
|
# # print(grief.path_similarity(love))
|
||||||
|
# # print(grief)
|
||||||
|
# print(grief[0].definition())
|
||||||
|
# print(love[0].definition())
|
||||||
|
|
||||||
|
abstractNouns = list([i for i in wn.synset('abstraction.n.06').closure(lambda s:s.hyponyms())])
|
||||||
|
print(len(abstractNouns))
|
||||||
|
|
||||||
|
d = {}
|
||||||
|
|
||||||
|
for n in abstractNouns:
|
||||||
|
if str(estimate(n.name())) in d.keys():
|
||||||
|
d[str(estimate(n.name()))].append(n.lemmas()[0].name())
|
||||||
|
else:
|
||||||
|
d[str(estimate(n.name()))] = [n.lemmas()[0].name()]
|
||||||
|
# print(n.lemmas()[0].name(),estimate(n.name()))
|
||||||
|
|
||||||
|
for i in d:
|
||||||
|
with open(f'{i}_syllable.txt', 'a') as f:
|
||||||
|
for ind, l in enumerate(d[i]):
|
||||||
|
if ind < len(d[i]) - 1:
|
||||||
|
f.write(f'{l}\n'.replace('_', ' '))
|
||||||
|
else:
|
||||||
|
f.write(f'{l}'.replace('_', ' '))
|
59
development/script.py
Normal file
59
development/script.py
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
#!/usr/local/bin/python3.8
|
||||||
|
import tweepy
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
import math
|
||||||
|
from nltk.corpus import wordnet as wn
|
||||||
|
|
||||||
|
print(datetime.now().strftime("%H:%M:%S"))
|
||||||
|
callback_uri = 'oob' # https://cfe.sh/twitter/callback
|
||||||
|
|
||||||
|
auth = tweepy.OAuthHandler(os.getenv('API_TOKEN'), os.getenv('API_KEY_SECRET'), callback_uri)
|
||||||
|
auth.set_access_token(os.getenv('ACCESS_TOKEN'), os.getenv('ACCESS_TOKEN_SECRET'))
|
||||||
|
|
||||||
|
api = tweepy.API(auth)
|
||||||
|
|
||||||
|
def generate_words():
|
||||||
|
syllables = random.randint(1,sum(1 for file in os.listdir('/usr/src/app/lists')))
|
||||||
|
w1 = get_word(syllables)
|
||||||
|
w2 = get_word(syllables)
|
||||||
|
while w1 == w2:
|
||||||
|
w2 = get_word(syllables)
|
||||||
|
return [w1,w2]
|
||||||
|
|
||||||
|
def get_word(syl):
|
||||||
|
fileName = f'{syl}_syllable.txt'
|
||||||
|
with open(f'/usr/src/app/lists/{fileName}', 'r') as wordList:
|
||||||
|
l = sum(1 for line in wordList) - 1
|
||||||
|
c = random.randint(0,l)
|
||||||
|
wordList.seek(0)
|
||||||
|
for i, line in enumerate(wordList):
|
||||||
|
if i == c:
|
||||||
|
if c == l:
|
||||||
|
return line
|
||||||
|
else:
|
||||||
|
return line[:-1]
|
||||||
|
elif i > c:
|
||||||
|
break
|
||||||
|
|
||||||
|
def posting():
|
||||||
|
words = generate_words()
|
||||||
|
output = f'What is {words[0]}, if not {words[1]} persevering?'
|
||||||
|
print(output)
|
||||||
|
# api.update_status(output)
|
||||||
|
with open('/usr/src/app/post_log.txt', 'a') as logFile:
|
||||||
|
logFile.write(f'{datetime.now().strftime("%Y-%m-%d-%X")}: {output}\n')
|
||||||
|
|
||||||
|
now = datetime.now()
|
||||||
|
nextHour = (now + timedelta(hours=1)).replace(minute=0,second=0,microsecond=0)
|
||||||
|
tdelta = nextHour - datetime.now()
|
||||||
|
sec = math.floor(tdelta.total_seconds())
|
||||||
|
print(f'Waiting until {nextHour} for first post, sleeping for {sec} seconds.')
|
||||||
|
time.sleep(sec)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
posting()
|
||||||
|
time.sleep(3600)
|
37
development/testScript.py
Normal file
37
development/testScript.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
from nltk.corpus import wordnet as wn
|
||||||
|
|
||||||
|
# syns = wn.synsets("program")
|
||||||
|
# print(syns[0].name())
|
||||||
|
|
||||||
|
# grief = wn.synsets('grief')
|
||||||
|
# love = wn.synsets('love')
|
||||||
|
|
||||||
|
# # print(grief.path_similarity(love))
|
||||||
|
# # print(grief)
|
||||||
|
# print(grief[0].definition())
|
||||||
|
# print(love[0].definition())
|
||||||
|
|
||||||
|
|
||||||
|
w1 = wn.synset('grief.n.01')
|
||||||
|
w2 = wn.synset('love.n.01')
|
||||||
|
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w2.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
|
||||||
|
# print(w1.hypernyms()[0],w2.hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
# print(w1.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0],w2.hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0].hypernyms()[0])
|
||||||
|
|
||||||
|
# print(wn.synsets('abstraction.n.06')[0])
|
||||||
|
|
||||||
|
abstractNouns = set([i for i in wn.synset('abstraction.n.06').closure(lambda s:s.hyponyms())])
|
||||||
|
print(len(abstractNouns))
|
||||||
|
|
||||||
|
abst = wn.synset('abstraction.n.06').hyponyms()
|
||||||
|
print(len(abst))
|
||||||
|
for n in abst:
|
||||||
|
print(n)
|
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
version: '3.4'
|
||||||
|
|
||||||
|
services:
|
||||||
|
perseveringbot-int:
|
||||||
|
build: ./interaction
|
||||||
|
volumes:
|
||||||
|
- ./interaction:/usr/src/app
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- BOT_VERSION=${BOT_VERSION}
|
||||||
|
- BEARER_TOKEN=${BEARER_TOKEN}
|
||||||
|
- ACCESS_TOKEN=${ACCESS_TOKEN}
|
||||||
|
- ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}
|
||||||
|
- API_TOKEN=${API_TOKEN}
|
||||||
|
- API_KEY_SECRET=${API_KEY_SECRET}
|
||||||
|
perseveringbot-pos:
|
||||||
|
build: ./posting
|
||||||
|
volumes:
|
||||||
|
- ./posting:/usr/src/app
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- BOT_VERSION=${BOT_VERSION}
|
||||||
|
- BEARER_TOKEN=${BEARER_TOKEN}
|
||||||
|
- ACCESS_TOKEN=${ACCESS_TOKEN}
|
||||||
|
- ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}
|
||||||
|
- API_TOKEN=${API_TOKEN}
|
||||||
|
- API_KEY_SECRET=${API_KEY_SECRET}
|
||||||
|
|
6
interaction/Dockerfile
Normal file
6
interaction/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM python:3.8.6-buster
|
||||||
|
COPY . /usr/src/app
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
CMD python3 -u ./script.py
|
1
interaction/last_seen.txt
Normal file
1
interaction/last_seen.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
1368349440298409985
|
3
interaction/requirements.txt
Normal file
3
interaction/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
python-dotenv
|
||||||
|
datetime
|
||||||
|
tweepy
|
63
interaction/script.py
Normal file
63
interaction/script.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/local/bin/python3.8
|
||||||
|
import tweepy
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
import re
|
||||||
|
import math
|
||||||
|
|
||||||
|
print(datetime.now().strftime("%H:%M:%S"))
|
||||||
|
callback_uri = 'oob' # https://cfe.sh/twitter/callback
|
||||||
|
|
||||||
|
auth = tweepy.OAuthHandler(os.getenv('API_TOKEN'), os.getenv('API_KEY_SECRET'), callback_uri)
|
||||||
|
auth.set_access_token(os.getenv('ACCESS_TOKEN'), os.getenv('ACCESS_TOKEN_SECRET'))
|
||||||
|
|
||||||
|
api = tweepy.API(auth)
|
||||||
|
lastSeenFile = '/usr/src/app/last_seen.txt'
|
||||||
|
|
||||||
|
def getLastSeen(filename):
|
||||||
|
with open(filename, 'r') as fileRead:
|
||||||
|
lastSeen = int(fileRead.read().strip())
|
||||||
|
return lastSeen
|
||||||
|
|
||||||
|
def storeLastSeen(filename, lastSeen):
|
||||||
|
with open(filename, 'w') as fileWrite:
|
||||||
|
fileWrite.write(str(lastSeen))
|
||||||
|
return
|
||||||
|
|
||||||
|
def searchTweets(query):
|
||||||
|
print('Searching for tweets')
|
||||||
|
lastSeen = getLastSeen(lastSeenFile)
|
||||||
|
tweets = api.search(query, since_id=lastSeen)
|
||||||
|
return tweets
|
||||||
|
|
||||||
|
def interactions():
|
||||||
|
tweets = searchTweets('persevering')
|
||||||
|
for tweet in reversed(tweets):
|
||||||
|
if not tweets:
|
||||||
|
print('No new tweets found.')
|
||||||
|
return
|
||||||
|
if re.search('what is.*if not.*persevering',tweet.text.lower()):
|
||||||
|
if not tweet.text.lower().startswith('rt') and tweet.user != api.me():
|
||||||
|
print(f'Tweet {tweet.text} by @{tweet.author.screen_name}', flush = True)
|
||||||
|
if not tweet.favorited:
|
||||||
|
print('Not favourited.')
|
||||||
|
# api.create_favorite(tweet.id)
|
||||||
|
if not tweet.retweeted:
|
||||||
|
print('Not retweeted.')
|
||||||
|
# api.retweet(tweet.id)
|
||||||
|
storeLastSeen(lastSeenFile, tweet.id)
|
||||||
|
|
||||||
|
now = datetime.now()
|
||||||
|
nextFifth = 5-(now.minute%5)
|
||||||
|
later = (now + timedelta(minutes=nextFifth)).replace(second=0,microsecond=0)
|
||||||
|
tdelta = later - datetime.now()
|
||||||
|
sec = math.floor(tdelta.total_seconds())
|
||||||
|
print(f'Waiting until {later} for first search interaction cycle, sleeping for {sec} seconds.')
|
||||||
|
time.sleep(sec)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
interactions()
|
||||||
|
print('Sleeping for 5 minutes')
|
||||||
|
time.sleep(300)
|
7
posting/Dockerfile
Normal file
7
posting/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM python:3.8.6-buster
|
||||||
|
COPY . /usr/src/app
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
RUN python -m nltk.downloader all
|
||||||
|
CMD python3 -u ./script.py
|
2835
posting/lists/1_syllable.txt
Normal file
2835
posting/lists/1_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
7315
posting/lists/2_syllable.txt
Normal file
7315
posting/lists/2_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
9740
posting/lists/3_syllable.txt
Normal file
9740
posting/lists/3_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
8950
posting/lists/4_syllable.txt
Normal file
8950
posting/lists/4_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
4956
posting/lists/5_syllable.txt
Normal file
4956
posting/lists/5_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
2387
posting/lists/6_syllable.txt
Normal file
2387
posting/lists/6_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
1200
posting/lists/7_syllable.txt
Normal file
1200
posting/lists/7_syllable.txt
Normal file
File diff suppressed because it is too large
Load Diff
571
posting/lists/8_syllable.txt
Normal file
571
posting/lists/8_syllable.txt
Normal file
@ -0,0 +1,571 @@
|
|||||||
|
psychological feature
|
||||||
|
indefinite quantity
|
||||||
|
mathematical relation
|
||||||
|
genital personality
|
||||||
|
incomprehensibility
|
||||||
|
uncommunicativeness
|
||||||
|
animal communication
|
||||||
|
system of weights and measures
|
||||||
|
ungradable opposition
|
||||||
|
physiological property
|
||||||
|
hydrogen ion concentration
|
||||||
|
absolute magnitude
|
||||||
|
interoperability
|
||||||
|
unintelligibility
|
||||||
|
environmental condition
|
||||||
|
sudden infant death syndrome
|
||||||
|
executive clemency
|
||||||
|
commercial letter of credit
|
||||||
|
traveler's letter of credit
|
||||||
|
mathematical statement
|
||||||
|
literary composition
|
||||||
|
division Archaebacteria
|
||||||
|
grammatical category
|
||||||
|
musical organization
|
||||||
|
computer memory unit
|
||||||
|
electromagnetic unit
|
||||||
|
unformatted capacity
|
||||||
|
basic cognitive process
|
||||||
|
higher cognitive process
|
||||||
|
internationalization
|
||||||
|
revolutions per minute
|
||||||
|
mechanical advantage
|
||||||
|
relative humidity
|
||||||
|
computer architecture
|
||||||
|
electronegativity
|
||||||
|
conformational entropy
|
||||||
|
one-dimensionality
|
||||||
|
incontrovertibility
|
||||||
|
speech intelligibility
|
||||||
|
esophagogastric junction
|
||||||
|
urinary hesitancy
|
||||||
|
collective security
|
||||||
|
indefatigability
|
||||||
|
telephone conversation
|
||||||
|
Latino sine flexione
|
||||||
|
declarative sentence
|
||||||
|
electronic database
|
||||||
|
circumstantial evidence
|
||||||
|
frequency-response curve
|
||||||
|
Talmudic literature
|
||||||
|
mathematical notation
|
||||||
|
electromagnetic spectrum
|
||||||
|
file allocation table
|
||||||
|
electromotive series
|
||||||
|
Homobasidiomycetes
|
||||||
|
coelenterate family
|
||||||
|
Iraqi National Congress
|
||||||
|
terrorist organization
|
||||||
|
ecumenical movement
|
||||||
|
professional association
|
||||||
|
Alcoholics Anonymous
|
||||||
|
American Labor Party
|
||||||
|
Liberal Democrat Party
|
||||||
|
Social Democratic Party
|
||||||
|
Industrial Workers of the World
|
||||||
|
administrative unit
|
||||||
|
intensive care unit
|
||||||
|
Helladic civilization
|
||||||
|
Mycenaean civilization
|
||||||
|
hunting and gathering tribe
|
||||||
|
metric capacity unit
|
||||||
|
Afghan monetary unit
|
||||||
|
Austrian monetary unit
|
||||||
|
British monetary unit
|
||||||
|
Chilean monetary unit
|
||||||
|
Cuban monetary unit
|
||||||
|
Cypriot monetary unit
|
||||||
|
Danish monetary unit
|
||||||
|
Finnish monetary unit
|
||||||
|
Gambian monetary unit
|
||||||
|
Georgian monetary unit
|
||||||
|
German monetary unit
|
||||||
|
Ghanian monetary unit
|
||||||
|
Guinean monetary unit
|
||||||
|
Haitian monetary unit
|
||||||
|
Indian monetary unit
|
||||||
|
Irish monetary unit
|
||||||
|
Kenyan monetary unit
|
||||||
|
Laotian monetary unit
|
||||||
|
Latvian monetary unit
|
||||||
|
Libyan monetary unit
|
||||||
|
Macao monetary unit
|
||||||
|
Myanmar monetary unit
|
||||||
|
Papuan monetary unit
|
||||||
|
Polish monetary unit
|
||||||
|
Russian monetary unit
|
||||||
|
Spanish monetary unit
|
||||||
|
Swedish monetary unit
|
||||||
|
Syrian monetary unit
|
||||||
|
Tongan monetary unit
|
||||||
|
Turkish monetary unit
|
||||||
|
Turkmen monetary unit
|
||||||
|
Zambian monetary unit
|
||||||
|
moment magnitude scale
|
||||||
|
nonverbal intelligence
|
||||||
|
political orientation
|
||||||
|
mitigating circumstance
|
||||||
|
representational process
|
||||||
|
out-of-body experience
|
||||||
|
adversative conjunction
|
||||||
|
copulative conjunction
|
||||||
|
subordinating conjunction
|
||||||
|
angular acceleration
|
||||||
|
basal metabolic rate
|
||||||
|
homogeneous polynomial
|
||||||
|
exogenous obesity
|
||||||
|
protective coloration
|
||||||
|
primary color for pigments
|
||||||
|
element of a cylinder
|
||||||
|
regular dodecahedron
|
||||||
|
regular icosahedron
|
||||||
|
balance-of-payments problem
|
||||||
|
biodegradable pollution
|
||||||
|
cardiovascular disease
|
||||||
|
histoincompatibility
|
||||||
|
salicylate poisoning
|
||||||
|
delusions of persecution
|
||||||
|
dissociative disorder
|
||||||
|
diplomatic immunity
|
||||||
|
cystoid macular edema
|
||||||
|
solitary confinement
|
||||||
|
electrolyte balance
|
||||||
|
political incorrectness
|
||||||
|
irreproducibility
|
||||||
|
signature recognition
|
||||||
|
Western Malayo-Polynesian
|
||||||
|
ablative absolute
|
||||||
|
hypertext transfer protocol
|
||||||
|
transmission control protocol
|
||||||
|
parol evidence rule
|
||||||
|
character assassination
|
||||||
|
relational database
|
||||||
|
conspiracy of silence
|
||||||
|
computer architecture
|
||||||
|
dictionary definition
|
||||||
|
ostensive definition
|
||||||
|
recursive definition
|
||||||
|
literal interpretation
|
||||||
|
Distinguished Conduct Medal
|
||||||
|
Distinguished Service Cross
|
||||||
|
derivative instrument
|
||||||
|
letters of administration
|
||||||
|
hexadecimal notation
|
||||||
|
parenthesis-free notation
|
||||||
|
asterid dicot family
|
||||||
|
dilleniid dicot family
|
||||||
|
magnoliid dicot family
|
||||||
|
liliid monocot family
|
||||||
|
genus Corynebacterium
|
||||||
|
genus Anomalopteryx
|
||||||
|
genus Ibero-mesornis
|
||||||
|
genus Appendicularia
|
||||||
|
caryophylloid dicot genus
|
||||||
|
hamamelid dicot genus
|
||||||
|
genus Aegyptopithecus
|
||||||
|
genus Australopithecus
|
||||||
|
suborder Ceratosaura
|
||||||
|
Aerobacter aerogenes
|
||||||
|
Francisella tularensis
|
||||||
|
Constitutional Convention
|
||||||
|
World Trade Organization
|
||||||
|
Protestant denomination
|
||||||
|
regulatory agency
|
||||||
|
United Nations agency
|
||||||
|
coronary care unit
|
||||||
|
Israeli Defense Force
|
||||||
|
parliamentary monarchy
|
||||||
|
Cycladic civilization
|
||||||
|
coefficient of self induction
|
||||||
|
coefficient of viscosity
|
||||||
|
British capacity unit
|
||||||
|
United States dry unit
|
||||||
|
Texas Independence Day
|
||||||
|
antiestablishmentarianism
|
||||||
|
philosophical doctrine
|
||||||
|
doctrine of analogy
|
||||||
|
humanistic discipline
|
||||||
|
imagination image
|
||||||
|
nonparametric statistic
|
||||||
|
hypercholesterolemia
|
||||||
|
anti-takeover defense
|
||||||
|
military ceremony
|
||||||
|
secondary education
|
||||||
|
undercover operation
|
||||||
|
emergency procedure
|
||||||
|
operating procedure
|
||||||
|
pictorial representation
|
||||||
|
entrance examination
|
||||||
|
retaliatory eviction
|
||||||
|
deliberate defense
|
||||||
|
psychological warfare
|
||||||
|
database management
|
||||||
|
cruel and unusual punishment
|
||||||
|
economic strangulation
|
||||||
|
initial public offering
|
||||||
|
gravitational collapse
|
||||||
|
military ceremony
|
||||||
|
elimination tournament
|
||||||
|
extremely high frequency
|
||||||
|
extremely low frequency
|
||||||
|
sodium tripolyphosphate
|
||||||
|
columbite-tantalite
|
||||||
|
liability insurance
|
||||||
|
malpractice insurance
|
||||||
|
capital expenditure
|
||||||
|
bank-depositor relation
|
||||||
|
conservator-ward relation
|
||||||
|
executor-heir relation
|
||||||
|
apatetic coloration
|
||||||
|
pediculosis capitis
|
||||||
|
pediculosis corporis
|
||||||
|
chromosomal aberration
|
||||||
|
fibrous dysplasia of bone
|
||||||
|
inhalation anesthesia
|
||||||
|
epidural anesthesia
|
||||||
|
circulatory failure
|
||||||
|
personality disorder
|
||||||
|
psychosomatic disorder
|
||||||
|
hyperlipoproteinemia
|
||||||
|
hypolipoproteinemia
|
||||||
|
lysine intolerance
|
||||||
|
anterograde amnesia
|
||||||
|
ecclesiastical province
|
||||||
|
marriage of convenience
|
||||||
|
papal infallibility
|
||||||
|
Social Security number
|
||||||
|
subornation of perjury
|
||||||
|
Presidential Directive
|
||||||
|
Bachelor of Arts in Nursing
|
||||||
|
Bachelor of Divinity
|
||||||
|
Bachelor of Medicine
|
||||||
|
Bachelor of Naval Science
|
||||||
|
Doctor of Dental Surgery
|
||||||
|
Doctor of Sacred Theology
|
||||||
|
Doctor of Humane Letters
|
||||||
|
Master of Architecture
|
||||||
|
Master of Library Science
|
||||||
|
Master of Literature
|
||||||
|
Higher National Diploma
|
||||||
|
statute of limitations
|
||||||
|
partnership certificate
|
||||||
|
registered security
|
||||||
|
zero-coupon security
|
||||||
|
software documentation
|
||||||
|
supervisory software
|
||||||
|
United States Senate
|
||||||
|
commodity brokerage
|
||||||
|
automobile industry
|
||||||
|
Federal Reserve System
|
||||||
|
Religious Society of Friends
|
||||||
|
Congregational Christian Church
|
||||||
|
Methodist denomination
|
||||||
|
United States government
|
||||||
|
Comptroller of the Currency
|
||||||
|
executive agency
|
||||||
|
Food and Drug Administration
|
||||||
|
law enforcement agency
|
||||||
|
National Weather Service
|
||||||
|
Nonproliferation Center
|
||||||
|
United States Air Force
|
||||||
|
United Nations Children's Fund
|
||||||
|
hypothetical creature
|
||||||
|
irrational hostility
|
||||||
|
Immaculate Conception
|
||||||
|
law of diminishing returns
|
||||||
|
law of multiple proportions
|
||||||
|
Pauli exclusion principle
|
||||||
|
landscape architecture
|
||||||
|
electrical engineering
|
||||||
|
information technology
|
||||||
|
mechanical engineering
|
||||||
|
secondary amenorrhea
|
||||||
|
keratoconjunctivitis
|
||||||
|
laryngotracheobronchitis
|
||||||
|
fetal alcohol syndrome
|
||||||
|
thoracic outlet syndrome
|
||||||
|
aversive conditioning
|
||||||
|
audio lingual acquisition
|
||||||
|
speaker identification
|
||||||
|
gravimetric analysis
|
||||||
|
volumetric analysis
|
||||||
|
volumetric analysis
|
||||||
|
line of least resistance
|
||||||
|
artificial respiration
|
||||||
|
interdepartmental support
|
||||||
|
digital communication
|
||||||
|
amplitude modulation
|
||||||
|
market capitalization
|
||||||
|
epideictic oratory
|
||||||
|
administrative hearing
|
||||||
|
bureaucratic procedure
|
||||||
|
academic requirement
|
||||||
|
employee-owned enterprise
|
||||||
|
subordinating conjunction
|
||||||
|
hypertext markup language
|
||||||
|
monoamine oxidase
|
||||||
|
manganese tetroxide
|
||||||
|
acid-base indicator
|
||||||
|
medullated nerve fiber
|
||||||
|
phosphate buffer solution
|
||||||
|
cumulative preferred
|
||||||
|
whole life insurance
|
||||||
|
political contribution
|
||||||
|
going-out-of-business sale
|
||||||
|
coronary heart disease
|
||||||
|
secondary hypertension
|
||||||
|
orthostatic hypotension
|
||||||
|
congestive heart failure
|
||||||
|
acute renal failure
|
||||||
|
agammaglobulinemia
|
||||||
|
posttraumatic stress disorder
|
||||||
|
opportunistic infection
|
||||||
|
staphylococcal infection
|
||||||
|
cartilaginification
|
||||||
|
hyperbilirubinemia
|
||||||
|
borderline schizophrenia
|
||||||
|
catatonic schizophrenia
|
||||||
|
ventricular septal defect
|
||||||
|
parenthetical expression
|
||||||
|
lexical disambiguation
|
||||||
|
cataloged procedure
|
||||||
|
contingency procedure
|
||||||
|
random number generator
|
||||||
|
supervisory routine
|
||||||
|
degree of a polynomial
|
||||||
|
duodecimal number system
|
||||||
|
octal numeration system
|
||||||
|
closely held corporation
|
||||||
|
multibank holding company
|
||||||
|
military academy
|
||||||
|
polytechnic institute
|
||||||
|
sales finance company
|
||||||
|
Real Estate Investment Trust
|
||||||
|
Federal Trade Commission
|
||||||
|
National Science Foundation
|
||||||
|
Federal Bureau of Prisons
|
||||||
|
Commission on Narcotic Drugs
|
||||||
|
modulus of rigidity
|
||||||
|
analysis of variance
|
||||||
|
rehabilitation program
|
||||||
|
dialectical materialism
|
||||||
|
conservation of energy
|
||||||
|
third law of thermodynamics
|
||||||
|
localization of function
|
||||||
|
beggar-my-neighbor policy
|
||||||
|
computational linguistics
|
||||||
|
cognitive psychology
|
||||||
|
differential psychology
|
||||||
|
unidentified flying object
|
||||||
|
coefficient of concordance
|
||||||
|
ulcerative colitis
|
||||||
|
equine encephalitis
|
||||||
|
West Nile encephalitis
|
||||||
|
necrotizing enteritis
|
||||||
|
inclusion body myositis
|
||||||
|
ankylosing spondylitis
|
||||||
|
vesicular stomatitis
|
||||||
|
secondary dysmenorrhea
|
||||||
|
instrumental conditioning
|
||||||
|
cost-benefit analysis
|
||||||
|
modified American plan
|
||||||
|
immunohistochemistry
|
||||||
|
object-oriented programming
|
||||||
|
Secretary of Commerce
|
||||||
|
Secretary of Defense
|
||||||
|
Secretary of Energy
|
||||||
|
Secretary of the Navy
|
||||||
|
counterpreparation fire
|
||||||
|
clandestine operation
|
||||||
|
strategic intelligence
|
||||||
|
tactical intelligence
|
||||||
|
natural family planning
|
||||||
|
arithmetic operation
|
||||||
|
dilation and curettage
|
||||||
|
palatopharyngoplasty
|
||||||
|
fundamental analysis
|
||||||
|
trespass quare clausum fregit
|
||||||
|
asynchronous transfer mode
|
||||||
|
pulse-time modulation
|
||||||
|
redirect examination
|
||||||
|
nonprofit organization
|
||||||
|
overcapitalization
|
||||||
|
operational damage
|
||||||
|
descriptive adjective
|
||||||
|
relational adjective
|
||||||
|
indefinite article
|
||||||
|
plasminogen activator
|
||||||
|
gastrointestinal hormone
|
||||||
|
obidoxime chloride
|
||||||
|
glycerinated gelatin
|
||||||
|
aluminum hydroxide
|
||||||
|
deoxyribonucleic acid
|
||||||
|
Philippine mahogany
|
||||||
|
hydrochlorofluorocarbon
|
||||||
|
organization expense
|
||||||
|
disability benefit
|
||||||
|
ventricular fibrillation
|
||||||
|
akinetic epilepsy
|
||||||
|
posttraumatic epilepsy
|
||||||
|
procursive epilepsy
|
||||||
|
psychomotor epilepsy
|
||||||
|
Arnold-Chiari deformity
|
||||||
|
communicable disease
|
||||||
|
fibrocystic breast disease
|
||||||
|
inflammatory disease
|
||||||
|
occupational disease
|
||||||
|
periarteritis nodosa
|
||||||
|
respiratory disease
|
||||||
|
metabolic acidosis
|
||||||
|
metabolic alkalosis
|
||||||
|
classic hemochromatosis
|
||||||
|
Charcot-Marie-Tooth disease
|
||||||
|
hepatojugular reflux
|
||||||
|
ureterorenal reflux
|
||||||
|
vesicoureteral reflux
|
||||||
|
disability of walking
|
||||||
|
command line interface
|
||||||
|
publishing conglomerate
|
||||||
|
staggered board of directors
|
||||||
|
anthropology department
|
||||||
|
holy day of obligation
|
||||||
|
conjugal visitation right
|
||||||
|
attorney-client privilege
|
||||||
|
conservation of momentum
|
||||||
|
numerical analysis
|
||||||
|
physical anthropology
|
||||||
|
supply-side economics
|
||||||
|
theory of inheritance
|
||||||
|
indefinite integral
|
||||||
|
horizontal integration
|
||||||
|
dishonorable discharge
|
||||||
|
physiological nystagmus
|
||||||
|
post-rotational nystagmus
|
||||||
|
glucose tolerance test
|
||||||
|
radioactive iodine test
|
||||||
|
catechetical instruction
|
||||||
|
preventive medicine
|
||||||
|
exfiltration operation
|
||||||
|
reconnaissance by fire
|
||||||
|
reconnaissance in force
|
||||||
|
A-scan ultrasonography
|
||||||
|
intravenous pyelography
|
||||||
|
oophorosalpingectomy
|
||||||
|
robotic telesurgery
|
||||||
|
electronic surveillance
|
||||||
|
surveillance of disease
|
||||||
|
fluorescence microscopy
|
||||||
|
isotonic exercise
|
||||||
|
gay liberation movement
|
||||||
|
international terrorism
|
||||||
|
state-sponsored terrorism
|
||||||
|
restriction endonuclease
|
||||||
|
water of crystallization
|
||||||
|
essential amino acid
|
||||||
|
cyclohexanol phthalate
|
||||||
|
aromatic hydrocarbon
|
||||||
|
potassium ferrocyanide
|
||||||
|
potassium permanganate
|
||||||
|
indolebutyric acid
|
||||||
|
supplementary benefit
|
||||||
|
unemployment compensation
|
||||||
|
cost-of-living allowance
|
||||||
|
depreciation allowance
|
||||||
|
reversionary annuity
|
||||||
|
involutional depression
|
||||||
|
photogenic epilepsy
|
||||||
|
hemorrhagic septicemia
|
||||||
|
lupus erythematosus
|
||||||
|
macular degeneration
|
||||||
|
lactose intolerance
|
||||||
|
valvular incompetence
|
||||||
|
urinary tract infection
|
||||||
|
necrobiosis lipoidica
|
||||||
|
sensorineural hearing loss
|
||||||
|
United States Cabinet
|
||||||
|
executive department
|
||||||
|
Immaculate Conception
|
||||||
|
equal protection of the laws
|
||||||
|
freedom from discrimination
|
||||||
|
freedom from double jeopardy
|
||||||
|
freedom from search and seizure
|
||||||
|
classical architecture
|
||||||
|
Victorian architecture
|
||||||
|
nonparametric statistics
|
||||||
|
elementary geometry
|
||||||
|
spherical trigonometry
|
||||||
|
general relativity
|
||||||
|
dissolution of marriage
|
||||||
|
Thematic Apperception Test
|
||||||
|
prolonged interrogation
|
||||||
|
radical hysterectomy
|
||||||
|
extracapsular surgery
|
||||||
|
intracapsular surgery
|
||||||
|
intramuscular injection
|
||||||
|
megavitamin therapy
|
||||||
|
occupational therapy
|
||||||
|
microwave spectroscopy
|
||||||
|
medroxyprogesterone
|
||||||
|
oxidized LDL cholesterol
|
||||||
|
saturated fatty acid
|
||||||
|
cellulose acetate
|
||||||
|
polypropenonitrile
|
||||||
|
polyvinyl acetate
|
||||||
|
bicarbonate of soda
|
||||||
|
magnesium bicarbonate
|
||||||
|
potassium bicarbonate
|
||||||
|
enteric-coated aspirin
|
||||||
|
filter-tipped cigarette
|
||||||
|
Hand-Schuller-Christian disease
|
||||||
|
infectious mononucleosis
|
||||||
|
diabetic retinopathy
|
||||||
|
Becker muscular dystrophy
|
||||||
|
distal muscular dystrophy
|
||||||
|
xanthoma disseminatum
|
||||||
|
intermittent claudication
|
||||||
|
Department of Education
|
||||||
|
Department of the Interior
|
||||||
|
Department of the Treasury
|
||||||
|
Department of Transportation
|
||||||
|
inflectional morphology
|
||||||
|
curvilinear correlation
|
||||||
|
negative correlation
|
||||||
|
positive correlation
|
||||||
|
emergency medicine
|
||||||
|
quantum electrodynamics
|
||||||
|
prisoner of war censorship
|
||||||
|
transorbital lobotomy
|
||||||
|
client-centered therapy
|
||||||
|
electron spin resonance
|
||||||
|
mono-iodotyrosine
|
||||||
|
cellulose triacetate
|
||||||
|
mucopolysaccharide
|
||||||
|
heterophil antibody
|
||||||
|
monoclonal antibody
|
||||||
|
megaloblastic anemia
|
||||||
|
sideroblastic anemia
|
||||||
|
granuloma inguinale
|
||||||
|
epidemic pleurodynia
|
||||||
|
tsutsugamushi disease
|
||||||
|
miliary tuberculosis
|
||||||
|
xeroderma pigmentosum
|
||||||
|
acute pyelonephritis
|
||||||
|
nonspecific urethritis
|
||||||
|
schistosome dermatitis
|
||||||
|
erythema multiforme
|
||||||
|
microscopic anatomy
|
||||||
|
cognitive neuroscience
|
||||||
|
magnetohydrodynamics
|
||||||
|
transactional immunity
|
||||||
|
reciprocal inhibition
|
||||||
|
hydroxybutyric acid
|
||||||
|
cluster of differentiation 4
|
||||||
|
cluster of differentiation 8
|
||||||
|
high-density lipoprotein
|
||||||
|
low-density lipoprotein
|
||||||
|
antihemophilic factor
|
||||||
|
Rocky Mountain spotted fever
|
||||||
|
endometrial carcinoma
|
||||||
|
alpha-linolenic acid
|
||||||
|
docosahexaenoic acid
|
||||||
|
eicosapentaenoic acid
|
279
posting/lists/9_syllable.txt
Normal file
279
posting/lists/9_syllable.txt
Normal file
@ -0,0 +1,279 @@
|
|||||||
|
auditory communication
|
||||||
|
narcissistic personality
|
||||||
|
small indefinite quantity
|
||||||
|
conditional probability
|
||||||
|
certificate of deposit
|
||||||
|
professional organization
|
||||||
|
absolute temperature
|
||||||
|
multiplicative inverse
|
||||||
|
military capability
|
||||||
|
operating capability
|
||||||
|
coronary insufficiency
|
||||||
|
meteorological conditions
|
||||||
|
anatomical reference
|
||||||
|
ballistic identification
|
||||||
|
biometric identification
|
||||||
|
multidimensional language
|
||||||
|
one-dimensional language
|
||||||
|
corroborating evidence
|
||||||
|
military intelligence
|
||||||
|
Heterobasidiomycetes
|
||||||
|
deliberative assembly
|
||||||
|
military-industrial complex
|
||||||
|
American Baptist Convention
|
||||||
|
educational institution
|
||||||
|
Congress of Racial Equality
|
||||||
|
Constitutional Union Party
|
||||||
|
States' Rights Democratic Party
|
||||||
|
parliamentary democracy
|
||||||
|
Paleo-American culture
|
||||||
|
pure imaginary number
|
||||||
|
factor of proportionality
|
||||||
|
basal body temperature
|
||||||
|
discriminative stimulus
|
||||||
|
centripetal acceleration
|
||||||
|
return on invested capital
|
||||||
|
borderline intelligence
|
||||||
|
complex instruction set computing
|
||||||
|
nonbiodegradable pollution
|
||||||
|
degenerative disorder
|
||||||
|
immunological disorder
|
||||||
|
carbon monoxide poisoning
|
||||||
|
spinocerebellar disorder
|
||||||
|
object-oriented database
|
||||||
|
stipulative definition
|
||||||
|
Distinguished Service Medal
|
||||||
|
Distinguished Service Order
|
||||||
|
articles of incorporation
|
||||||
|
caryophylloid dicot family
|
||||||
|
hamamelid dicot family
|
||||||
|
Schizosaccharomycetaceae
|
||||||
|
Agrobacterium tumefaciens
|
||||||
|
Royal Canadian Mounted Police
|
||||||
|
Federal Home Loan Bank System
|
||||||
|
extended care facility
|
||||||
|
redevelopment authority
|
||||||
|
coefficient of mutual induction
|
||||||
|
luminous intensity unit
|
||||||
|
Trinidad and Tobago dollar
|
||||||
|
Central African Republic franc
|
||||||
|
United States liquid unit
|
||||||
|
Cartesian coordinate system
|
||||||
|
inertial reference frame
|
||||||
|
elementary education
|
||||||
|
quantitative analysis
|
||||||
|
psychological operation
|
||||||
|
experimental procedure
|
||||||
|
electronic communication
|
||||||
|
comparative negligence
|
||||||
|
contributory negligence
|
||||||
|
demand for identification
|
||||||
|
economic mobilization
|
||||||
|
proportional representation
|
||||||
|
electromagnetic intrusion
|
||||||
|
electronic countermeasures
|
||||||
|
atmospheric electricity
|
||||||
|
case-fatality proportion
|
||||||
|
case-to-infection proportion
|
||||||
|
identification particle
|
||||||
|
complementary distribution
|
||||||
|
automobile insurance
|
||||||
|
director-stockholder relation
|
||||||
|
receiver-creditor relation
|
||||||
|
aposematic coloration
|
||||||
|
atrioventricular nodal rhythm
|
||||||
|
interventricular foramen
|
||||||
|
occipital protuberance
|
||||||
|
inborn error of metabolism
|
||||||
|
auditory hallucination
|
||||||
|
hypersensitivity reaction
|
||||||
|
bank identification number
|
||||||
|
partial differential equation
|
||||||
|
Associate in Applied Science
|
||||||
|
Bachelor of Literature
|
||||||
|
Doctor of Dental Medicine
|
||||||
|
personality inventory
|
||||||
|
mortgage-backed security
|
||||||
|
proprietorship certificate
|
||||||
|
United States Marine Corps
|
||||||
|
Anabaptist denomination
|
||||||
|
Bureau of Engraving and Printing
|
||||||
|
Bureau of Justice Statistics
|
||||||
|
Casualty Care Research Center
|
||||||
|
Defense Logistics Agency
|
||||||
|
Federal Aviation Agency
|
||||||
|
Government Accounting Office
|
||||||
|
Internal Revenue Service
|
||||||
|
National Institutes of Health
|
||||||
|
Technology Administration
|
||||||
|
United States Border Patrol
|
||||||
|
political action committee
|
||||||
|
Economic and Social Council
|
||||||
|
Intelligence Community
|
||||||
|
military intelligence
|
||||||
|
Federal Security Bureau
|
||||||
|
United Nations Secretariat
|
||||||
|
National Rifle Association
|
||||||
|
coefficient of elasticity
|
||||||
|
multivariate analysis
|
||||||
|
law of equivalent proportions
|
||||||
|
principle of relativity
|
||||||
|
aeronautical engineering
|
||||||
|
architectural engineering
|
||||||
|
periodic apnea of the newborn
|
||||||
|
attention deficit disorder
|
||||||
|
Chinese restaurant syndrome
|
||||||
|
Zollinger-Ellison syndrome
|
||||||
|
Revolutionary calendar
|
||||||
|
total parenteral nutrition
|
||||||
|
integrated logistic support
|
||||||
|
alienation of affection
|
||||||
|
adenosine deaminase
|
||||||
|
superoxide dismutase
|
||||||
|
high-level radioactive waste
|
||||||
|
low-level radioactive waste
|
||||||
|
monostotic fibrous dysplasia
|
||||||
|
benign prostatic hyperplasia
|
||||||
|
hypogammaglobulinemia
|
||||||
|
schizotypal personality
|
||||||
|
abetalipoproteinemia
|
||||||
|
Wernicke's encephalopathy
|
||||||
|
respiratory tract infection
|
||||||
|
binary numeration system
|
||||||
|
decimal numeration system
|
||||||
|
hexadecimal number system
|
||||||
|
attributive genitive
|
||||||
|
captive finance company
|
||||||
|
commercial finance company
|
||||||
|
consumer finance company
|
||||||
|
Atomic Energy Commission
|
||||||
|
National Security Council
|
||||||
|
National Labor Relations Board
|
||||||
|
Small Business Administration
|
||||||
|
United States Post Office
|
||||||
|
Social Development Commission
|
||||||
|
United States Army Rangers
|
||||||
|
Reserve Officers Training Corps
|
||||||
|
diamond wedding anniversary
|
||||||
|
golden wedding anniversary
|
||||||
|
silver wedding anniversary
|
||||||
|
correlational analysis
|
||||||
|
Maxwell-Boltzmann distribution law
|
||||||
|
second law of thermodynamics
|
||||||
|
zeroth law of thermodynamics
|
||||||
|
law of independent assortment
|
||||||
|
Gestalt law of organization
|
||||||
|
mass-energy equivalence
|
||||||
|
principle of equivalence
|
||||||
|
principle of superposition
|
||||||
|
principle of superposition
|
||||||
|
artificial intelligence
|
||||||
|
natural language processing
|
||||||
|
comparative psychology
|
||||||
|
developmental psychology
|
||||||
|
experimental psychology
|
||||||
|
physiological psychology
|
||||||
|
Kendall partial rank correlation
|
||||||
|
tau coefficient of correlation
|
||||||
|
irritable bowel syndrome
|
||||||
|
herpes simplex encephalitis
|
||||||
|
sense of responsibility
|
||||||
|
Secretary of Education
|
||||||
|
Secretary of the Interior
|
||||||
|
Secretary of the Treasury
|
||||||
|
Secretary of Transportation
|
||||||
|
aeronautical engineering
|
||||||
|
automotive technology
|
||||||
|
communications technology
|
||||||
|
trespass de bonis asportatis
|
||||||
|
hyperemesis gravidarum
|
||||||
|
insertional mutagenesis
|
||||||
|
para aminobenzoic acid
|
||||||
|
quaternary ammonium compound
|
||||||
|
fluorescein isothiocyanate
|
||||||
|
abdominal aortic aneurysm
|
||||||
|
hypertrophic cardiomyopathy
|
||||||
|
respiratory acidosis
|
||||||
|
respiratory alkalosis
|
||||||
|
acquired hemochromatosis
|
||||||
|
multiple mononeuropathy
|
||||||
|
natural language processor
|
||||||
|
graphical user interface
|
||||||
|
department of computer science
|
||||||
|
equality before the law
|
||||||
|
right to the pursuit of happiness
|
||||||
|
physician-patient privilege
|
||||||
|
stationary stochastic process
|
||||||
|
primary sex characteristic
|
||||||
|
rubella panencephalitis
|
||||||
|
just-noticeable difference
|
||||||
|
planetesimal hypothesis
|
||||||
|
zero-tolerance policy
|
||||||
|
alternative medicine
|
||||||
|
complementary medicine
|
||||||
|
security intelligence
|
||||||
|
electronic reconnaissance
|
||||||
|
electronics intelligence
|
||||||
|
telemetry intelligence
|
||||||
|
cyclodestructive surgery
|
||||||
|
laser trabecular surgery
|
||||||
|
computerized tomography
|
||||||
|
growth hormone-releasing factor
|
||||||
|
glutathione peroxidase
|
||||||
|
horseradish peroxidase
|
||||||
|
recombinant human insulin
|
||||||
|
urea-formaldehyde resin
|
||||||
|
alkylbenzenesulfonate
|
||||||
|
disability insurance
|
||||||
|
musicogenic epilepsy
|
||||||
|
thrombocytopenic purpura
|
||||||
|
mucopolysaccharidosis
|
||||||
|
mucocutaneous leishmaniasis
|
||||||
|
Ebola hemorrhagic fever
|
||||||
|
polycystic kidney disease
|
||||||
|
freedom from self-incrimination
|
||||||
|
Byzantine architecture
|
||||||
|
vertebrate paleontology
|
||||||
|
abatement of a nuisance
|
||||||
|
Michelson-Morley experiment
|
||||||
|
breach of trust with fraudulent intent
|
||||||
|
El Nino southern oscillation
|
||||||
|
unsaturated fatty acid
|
||||||
|
adenosine diphosphate
|
||||||
|
adenosine triphosphate
|
||||||
|
prostate specific antigen
|
||||||
|
polymethyl methacrylate
|
||||||
|
erythroblastosis fetalis
|
||||||
|
iron deficiency anemia
|
||||||
|
essential thrombocytopenia
|
||||||
|
osteogenesis imperfecta
|
||||||
|
limb-girdle muscular dystrophy
|
||||||
|
Duchenne's muscular dystrophy
|
||||||
|
myotonic muscular dystrophy
|
||||||
|
keratosis blennorrhagica
|
||||||
|
keratosis follicularis
|
||||||
|
Department of Agriculture
|
||||||
|
Department of Veterans Affairs
|
||||||
|
derivational morphology
|
||||||
|
veterinary medicine
|
||||||
|
physical rehabilitation
|
||||||
|
physician-assisted suicide
|
||||||
|
adrenergic agonist eyedrop
|
||||||
|
topical prostaglandin eyedrop
|
||||||
|
thoracic actinomycosis
|
||||||
|
lymphogranuloma venereum
|
||||||
|
cerebrospinal meningitis
|
||||||
|
pulmonary tuberculosis
|
||||||
|
nongonococcal urethritis
|
||||||
|
comparative anatomy
|
||||||
|
developmental anatomy
|
||||||
|
desensitization technique
|
||||||
|
human reproductive cloning
|
||||||
|
monoamine neurotransmitter
|
||||||
|
carboxymethyl cellulose
|
||||||
|
tetanus immunoglobulin
|
||||||
|
chronic lymphocytic leukemia
|
||||||
|
chronic myelocytic leukemia
|
||||||
|
alveolar rhabdomyosarcoma
|
||||||
|
embryonal rhabdomyosarcoma
|
||||||
|
pleomorphic rhabdomyosarcoma
|
1
posting/post_log.txt
Normal file
1
posting/post_log.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
2021-03-19-00:28:14: What is artificial intelligence, if not mucopolysaccharidosis persevering?
|
5
posting/requirements.txt
Normal file
5
posting/requirements.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
python-dotenv
|
||||||
|
datetime
|
||||||
|
tweepy
|
||||||
|
nltk
|
||||||
|
numpy
|
64
posting/script.py
Normal file
64
posting/script.py
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/local/bin/python3.8
|
||||||
|
import tweepy
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
import math
|
||||||
|
from nltk.corpus import wordnet as wn
|
||||||
|
|
||||||
|
print(datetime.now().strftime("%H:%M:%S"))
|
||||||
|
callback_uri = 'oob' # https://cfe.sh/twitter/callback
|
||||||
|
|
||||||
|
auth = tweepy.OAuthHandler(os.getenv('API_TOKEN'), os.getenv('API_KEY_SECRET'), callback_uri)
|
||||||
|
auth.set_access_token(os.getenv('ACCESS_TOKEN'), os.getenv('ACCESS_TOKEN_SECRET'))
|
||||||
|
|
||||||
|
api = tweepy.API(auth)
|
||||||
|
|
||||||
|
def generate_words():
|
||||||
|
syllables = random.randint(1,sum(1 for file in os.listdir('/usr/src/app/lists')))
|
||||||
|
w1 = get_word(syllables)
|
||||||
|
w2 = get_word(syllables)
|
||||||
|
w1_synset = wn.synsets(w1.replace(' ', '_'))[0]
|
||||||
|
w2_synset = wn.synsets(w2.replace(' ', '_'))[0]
|
||||||
|
i = 0
|
||||||
|
while w1 == w2 or (w1_synset.wup_similarity(w2_synset) < 0.66 and i < 100):
|
||||||
|
w2 = get_word(syllables)
|
||||||
|
w2_synset = wn.synsets(w2.replace(' ', '_'))[0]
|
||||||
|
i += 1
|
||||||
|
return [w1,w2]
|
||||||
|
|
||||||
|
def get_word(syl):
|
||||||
|
fileName = f'{syl}_syllable.txt'
|
||||||
|
with open(f'/usr/src/app/lists/{fileName}', 'r') as wordList:
|
||||||
|
l = sum(1 for line in wordList) - 1
|
||||||
|
c = random.randint(0,l)
|
||||||
|
wordList.seek(0)
|
||||||
|
for i, line in enumerate(wordList):
|
||||||
|
if i == c:
|
||||||
|
if c == l:
|
||||||
|
return line
|
||||||
|
else:
|
||||||
|
return line[:-1]
|
||||||
|
elif i > c:
|
||||||
|
break
|
||||||
|
|
||||||
|
def posting():
|
||||||
|
words = generate_words()
|
||||||
|
output = f'What is {words[0]}, if not {words[1]} persevering?'
|
||||||
|
print(output)
|
||||||
|
# api.update_status(output)
|
||||||
|
with open('/usr/src/app/post_log.txt', 'a') as logFile:
|
||||||
|
logFile.write(f'{datetime.now().strftime("%Y-%m-%d-%X")}: {output}\n')
|
||||||
|
|
||||||
|
now = datetime.now()
|
||||||
|
nextHour = (now + timedelta(hours=1)).replace(minute=0,second=0,microsecond=0)
|
||||||
|
tdelta = nextHour - datetime.now()
|
||||||
|
sec = math.floor(tdelta.total_seconds())
|
||||||
|
print(f'Waiting until {nextHour} for first post, sleeping for {sec} seconds.')
|
||||||
|
time.sleep(sec)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
posting()
|
||||||
|
time.sleep(3600)
|
Loading…
Reference in New Issue
Block a user