this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial commit.

alice a68c6666

+567
+2
.gitignore
··· 1 + .env 2 + .vscode/
+18
Pipfile
··· 1 + [[source]] 2 + url = "https://pypi.org/simple" 3 + verify_ssl = true 4 + name = "pypi" 5 + 6 + [packages] 7 + tweepy = "*" 8 + python-dotenv = "*" 9 + 10 + [dev-packages] 11 + flake8 = "*" 12 + black = "*" 13 + 14 + [requires] 15 + python_version = "3.10" 16 + 17 + [pipenv] 18 + allow_prereleases = true
+233
Pipfile.lock
··· 1 + { 2 + "_meta": { 3 + "hash": { 4 + "sha256": "32d2faf1915749d68980331faab08a8b683906f254326628f5d6806768bb195e" 5 + }, 6 + "pipfile-spec": 6, 7 + "requires": { 8 + "python_version": "3.10" 9 + }, 10 + "sources": [ 11 + { 12 + "name": "pypi", 13 + "url": "https://pypi.org/simple", 14 + "verify_ssl": true 15 + } 16 + ] 17 + }, 18 + "default": { 19 + "certifi": { 20 + "hashes": [ 21 + "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", 22 + "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" 23 + ], 24 + "version": "==2021.10.8" 25 + }, 26 + "charset-normalizer": { 27 + "hashes": [ 28 + "sha256:e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0", 29 + "sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b" 30 + ], 31 + "markers": "python_version >= '3'", 32 + "version": "==2.0.7" 33 + }, 34 + "idna": { 35 + "hashes": [ 36 + "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", 37 + "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" 38 + ], 39 + "markers": "python_version >= '3'", 40 + "version": "==3.3" 41 + }, 42 + "oauthlib": { 43 + "hashes": [ 44 + "sha256:42bf6354c2ed8c6acb54d971fce6f88193d97297e18602a3a886603f9d7730cc", 45 + "sha256:8f0215fcc533dd8dd1bee6f4c412d4f0cd7297307d43ac61666389e3bc3198a3" 46 + ], 47 + "markers": "python_version >= '3.6'", 48 + "version": "==3.1.1" 49 + }, 50 + "python-dotenv": { 51 + "hashes": [ 52 + "sha256:32b2bdc1873fd3a3c346da1c6db83d0053c3c62f28f1f38516070c4c8971b1d3", 53 + "sha256:a5de49a31e953b45ff2d2fd434bbc2670e8db5273606c1e737cc6b93eff3655f" 54 + ], 55 + "index": "pypi", 56 + "version": "==0.19.2" 57 + }, 58 + "requests": { 59 + "hashes": [ 60 + "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", 61 + "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7" 62 + ], 63 + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", 64 + "version": "==2.26.0" 65 + }, 66 + "requests-oauthlib": { 67 + "hashes": [ 68 + "sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d", 69 + "sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a", 70 + "sha256:fa6c47b933f01060936d87ae9327fead68768b69c6c9ea2109c48be30f2d4dbc" 71 + ], 72 + "version": "==1.3.0" 73 + }, 74 + "tweepy": { 75 + "hashes": [ 76 + "sha256:6c604ff31b18a93ffc9a23f0f017a292f6339eb0727169e093f98cd23fe85980", 77 + "sha256:b0ac20cf6c864929f7ee4726099a445ff16c6161ff8fa72075b104b9dbfff3ff" 78 + ], 79 + "index": "pypi", 80 + "version": "==4.3.0" 81 + }, 82 + "urllib3": { 83 + "hashes": [ 84 + "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", 85 + "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" 86 + ], 87 + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", 88 + "version": "==1.26.7" 89 + } 90 + }, 91 + "develop": { 92 + "black": { 93 + "hashes": [ 94 + "sha256:6eb7448da9143ee65b856a5f3676b7dda98ad9abe0f87fce8c59291f15e82a5b", 95 + "sha256:a9952229092e325fe5f3dae56d81f639b23f7131eb840781947e4b2886030f33" 96 + ], 97 + "index": "pypi", 98 + "version": "==21.10b0" 99 + }, 100 + "click": { 101 + "hashes": [ 102 + "sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3", 103 + "sha256:410e932b050f5eed773c4cda94de75971c89cdb3155a72a0831139a79e5ecb5b" 104 + ], 105 + "markers": "python_version >= '3.6'", 106 + "version": "==8.0.3" 107 + }, 108 + "flake8": { 109 + "hashes": [ 110 + "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d", 111 + "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d" 112 + ], 113 + "index": "pypi", 114 + "version": "==4.0.1" 115 + }, 116 + "mccabe": { 117 + "hashes": [ 118 + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", 119 + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" 120 + ], 121 + "version": "==0.6.1" 122 + }, 123 + "mypy-extensions": { 124 + "hashes": [ 125 + "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d", 126 + "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" 127 + ], 128 + "version": "==0.4.3" 129 + }, 130 + "pathspec": { 131 + "hashes": [ 132 + "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a", 133 + "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1" 134 + ], 135 + "version": "==0.9.0" 136 + }, 137 + "platformdirs": { 138 + "hashes": [ 139 + "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2", 140 + "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d" 141 + ], 142 + "markers": "python_version >= '3.6'", 143 + "version": "==2.4.0" 144 + }, 145 + "pycodestyle": { 146 + "hashes": [ 147 + "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20", 148 + "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f" 149 + ], 150 + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", 151 + "version": "==2.8.0" 152 + }, 153 + "pyflakes": { 154 + "hashes": [ 155 + "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c", 156 + "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e" 157 + ], 158 + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", 159 + "version": "==2.4.0" 160 + }, 161 + "regex": { 162 + "hashes": [ 163 + "sha256:05b7d6d7e64efe309972adab77fc2af8907bb93217ec60aa9fe12a0dad35874f", 164 + "sha256:0617383e2fe465732af4509e61648b77cbe3aee68b6ac8c0b6fe934db90be5cc", 165 + "sha256:07856afef5ffcc052e7eccf3213317fbb94e4a5cd8177a2caa69c980657b3cb4", 166 + "sha256:162abfd74e88001d20cb73ceaffbfe601469923e875caf9118333b1a4aaafdc4", 167 + "sha256:2207ae4f64ad3af399e2d30dde66f0b36ae5c3129b52885f1bffc2f05ec505c8", 168 + "sha256:30ab804ea73972049b7a2a5c62d97687d69b5a60a67adca07eb73a0ddbc9e29f", 169 + "sha256:3b5df18db1fccd66de15aa59c41e4f853b5df7550723d26aa6cb7f40e5d9da5a", 170 + "sha256:3c5fb32cc6077abad3bbf0323067636d93307c9fa93e072771cf9a64d1c0f3ef", 171 + "sha256:416c5f1a188c91e3eb41e9c8787288e707f7d2ebe66e0a6563af280d9b68478f", 172 + "sha256:432bd15d40ed835a51617521d60d0125867f7b88acf653e4ed994a1f8e4995dc", 173 + "sha256:4aaa4e0705ef2b73dd8e36eeb4c868f80f8393f5f4d855e94025ce7ad8525f50", 174 + "sha256:537ca6a3586931b16a85ac38c08cc48f10fc870a5b25e51794c74df843e9966d", 175 + "sha256:53db2c6be8a2710b359bfd3d3aa17ba38f8aa72a82309a12ae99d3c0c3dcd74d", 176 + "sha256:5537f71b6d646f7f5f340562ec4c77b6e1c915f8baae822ea0b7e46c1f09b733", 177 + "sha256:6650f16365f1924d6014d2ea770bde8555b4a39dc9576abb95e3cd1ff0263b36", 178 + "sha256:666abff54e474d28ff42756d94544cdfd42e2ee97065857413b72e8a2d6a6345", 179 + "sha256:68a067c11463de2a37157930d8b153005085e42bcb7ad9ca562d77ba7d1404e0", 180 + "sha256:780b48456a0f0ba4d390e8b5f7c661fdd218934388cde1a974010a965e200e12", 181 + "sha256:788aef3549f1924d5c38263104dae7395bf020a42776d5ec5ea2b0d3d85d6646", 182 + "sha256:7ee1227cf08b6716c85504aebc49ac827eb88fcc6e51564f010f11a406c0a667", 183 + "sha256:7f301b11b9d214f83ddaf689181051e7f48905568b0c7017c04c06dfd065e244", 184 + "sha256:83ee89483672b11f8952b158640d0c0ff02dc43d9cb1b70c1564b49abe92ce29", 185 + "sha256:85bfa6a5413be0ee6c5c4a663668a2cad2cbecdee367630d097d7823041bdeec", 186 + "sha256:9345b6f7ee578bad8e475129ed40123d265464c4cfead6c261fd60fc9de00bcf", 187 + "sha256:93a5051fcf5fad72de73b96f07d30bc29665697fb8ecdfbc474f3452c78adcf4", 188 + "sha256:962b9a917dd7ceacbe5cd424556914cb0d636001e393b43dc886ba31d2a1e449", 189 + "sha256:98ba568e8ae26beb726aeea2273053c717641933836568c2a0278a84987b2a1a", 190 + "sha256:a3feefd5e95871872673b08636f96b61ebef62971eab044f5124fb4dea39919d", 191 + "sha256:b43c2b8a330a490daaef5a47ab114935002b13b3f9dc5da56d5322ff218eeadb", 192 + "sha256:b483c9d00a565633c87abd0aaf27eb5016de23fed952e054ecc19ce32f6a9e7e", 193 + "sha256:ba05430e819e58544e840a68b03b28b6d328aff2e41579037e8bab7653b37d83", 194 + "sha256:ca5f18a75e1256ce07494e245cdb146f5a9267d3c702ebf9b65c7f8bd843431e", 195 + "sha256:d5ca078bb666c4a9d1287a379fe617a6dccd18c3e8a7e6c7e1eb8974330c626a", 196 + "sha256:da1a90c1ddb7531b1d5ff1e171b4ee61f6345119be7351104b67ff413843fe94", 197 + "sha256:dba70f30fd81f8ce6d32ddeef37d91c8948e5d5a4c63242d16a2b2df8143aafc", 198 + "sha256:dd33eb9bdcfbabab3459c9ee651d94c842bc8a05fabc95edf4ee0c15a072495e", 199 + "sha256:e0538c43565ee6e703d3a7c3bdfe4037a5209250e8502c98f20fea6f5fdf2965", 200 + "sha256:e1f54b9b4b6c53369f40028d2dd07a8c374583417ee6ec0ea304e710a20f80a0", 201 + "sha256:e32d2a2b02ccbef10145df9135751abea1f9f076e67a4e261b05f24b94219e36", 202 + "sha256:e71255ba42567d34a13c03968736c5d39bb4a97ce98188fafb27ce981115beec", 203 + "sha256:ed2e07c6a26ed4bea91b897ee2b0835c21716d9a469a96c3e878dc5f8c55bb23", 204 + "sha256:eef2afb0fd1747f33f1ee3e209bce1ed582d1896b240ccc5e2697e3275f037c7", 205 + "sha256:f23222527b307970e383433daec128d769ff778d9b29343fb3496472dc20dabe", 206 + "sha256:f341ee2df0999bfdf7a95e448075effe0db212a59387de1a70690e4acb03d4c6", 207 + "sha256:f7f325be2804246a75a4f45c72d4ce80d2443ab815063cdf70ee8fb2ca59ee1b", 208 + "sha256:f8af619e3be812a2059b212064ea7a640aff0568d972cd1b9e920837469eb3cb", 209 + "sha256:fa8c626d6441e2d04b6ee703ef2d1e17608ad44c7cb75258c09dd42bacdfc64b", 210 + "sha256:fbb9dc00e39f3e6c0ef48edee202f9520dafb233e8b51b06b8428cfcb92abd30", 211 + "sha256:fff55f3ce50a3ff63ec8e2a8d3dd924f1941b250b0aac3d3d42b687eeff07a8e" 212 + ], 213 + "version": "==2021.11.10" 214 + }, 215 + "tomli": { 216 + "hashes": [ 217 + "sha256:c6ce0015eb38820eaf32b5db832dbc26deb3dd427bd5f6556cf0acac2c214fee", 218 + "sha256:f04066f68f5554911363063a30b108d2b5a5b1a010aa8b6132af78489fe3aade" 219 + ], 220 + "markers": "python_version >= '3.6'", 221 + "version": "==1.2.2" 222 + }, 223 + "typing-extensions": { 224 + "hashes": [ 225 + "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e", 226 + "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7", 227 + "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34" 228 + ], 229 + "markers": "python_version >= '3.10'", 230 + "version": "==3.10.0.2" 231 + } 232 + } 233 + }
+289
app.py
··· 1 + import tweepy 2 + import logging 3 + from config import create_api 4 + import time 5 + import random 6 + 7 + logging.basicConfig(level=logging.INFO) 8 + logger = logging.getLogger() 9 + 10 + acx_articles = [ 11 + "https://astralcodexten.substack.com/p/open-thread-1975", 12 + "https://astralcodexten.substack.com/p/apply-for-an-acx-grant", 13 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-orban", 14 + "https://astralcodexten.substack.com/p/secrets-of-the-great-families", 15 + "https://astralcodexten.substack.com/p/model-city-monday-11821", 16 + "https://astralcodexten.substack.com/p/open-thread-197", 17 + "https://astralcodexten.substack.com/p/open-thread-1965", 18 + "https://astralcodexten.substack.com/p/dictator-book-club-orban", 19 + "https://astralcodexten.substack.com/p/non-cognitive-skills-for-educational", 20 + "https://astralcodexten.substack.com/p/mantic-monday-11121", 21 + "https://astralcodexten.substack.com/p/open-thread-196", 22 + "https://astralcodexten.substack.com/p/jhanas-and-the-dark-room-problem", 23 + "https://astralcodexten.substack.com/p/learn-british-english-with-acx", 24 + "https://astralcodexten.substack.com/p/epistemic-minor-leagues", 25 + "https://astralcodexten.substack.com/p/open-thread-195-cambridgeedinburgh", 26 + "https://astralcodexten.substack.com/p/chilling-effects", 27 + "https://astralcodexten.substack.com/p/open-thread-194-londonoxford-meetups", 28 + "https://astralcodexten.substack.com/p/links-for-october", 29 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-kids", 30 + "https://astralcodexten.substack.com/p/please-dont-give-up-on-having-kids", 31 + "https://astralcodexten.substack.com/p/learn-german-with-acx", 32 + "https://astralcodexten.substack.com/p/open-thread-192-berlinparis-meetups", 33 + "https://astralcodexten.substack.com/p/classifieds-thread-102021", 34 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-modern", 35 + "https://astralcodexten.substack.com/p/open-thread-192-viennaprague-meetups", 36 + "https://astralcodexten.substack.com/p/learn-spanish-with-acx", 37 + "https://astralcodexten.substack.com/p/open-thread-1915", 38 + "https://astralcodexten.substack.com/p/book-review-the-scout-mindset", 39 + "https://astralcodexten.substack.com/p/open-thread-191-madridzurich-meetups", 40 + "https://astralcodexten.substack.com/p/whither-tartaria", 41 + "https://astralcodexten.substack.com/p/learn-portuguese-with-acx", 42 + "https://astralcodexten.substack.com/p/links-for-september", 43 + "https://astralcodexten.substack.com/p/open-thread-190", 44 + "https://astralcodexten.substack.com/p/lisbon-meetup-this-saturday", 45 + "https://astralcodexten.substack.com/p/book-review-the-revolt-of-the-public", 46 + "https://astralcodexten.substack.com/p/open-thread-1895", 47 + "https://astralcodexten.substack.com/p/book-review-modi-a-political-biography", 48 + "https://astralcodexten.substack.com/p/open-thread-189", 49 + "https://astralcodexten.substack.com/p/washington-dc-meetup-this-saturday", 50 + "https://astralcodexten.substack.com/p/open-thread-1885", 51 + "https://astralcodexten.substack.com/p/the-unbearable-semiheaviness-of-being", 52 + "https://astralcodexten.substack.com/p/too-good-to-check-a-play-in-three", 53 + "https://astralcodexten.substack.com/p/new-york-meetup-this-monday", 54 + "https://astralcodexten.substack.com/p/open-thread-188", 55 + "https://astralcodexten.substack.com/p/boston-meetup-this-sunday", 56 + "https://astralcodexten.substack.com/p/long-covid-much-more-than-you-wanted", 57 + "https://astralcodexten.substack.com/p/open-thread-1875", 58 + "https://astralcodexten.substack.com/p/peer-review-long-covid-much-more", 59 + "https://astralcodexten.substack.com/p/on-hreha-on-behavioral-economics", 60 + "https://astralcodexten.substack.com/p/open-thread-187", 61 + "https://astralcodexten.substack.com/p/berkeley-meetup-this-saturday", 62 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-missing", 63 + "https://astralcodexten.substack.com/p/if-youre-so-smart-why-arent-you-governor", 64 + "https://astralcodexten.substack.com/p/carbon-costs-quantified", 65 + "https://astralcodexten.substack.com/p/meetups-everywhere-2021-times-and", 66 + "https://astralcodexten.substack.com/p/open-thread-186", 67 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-aducanumab", 68 + "https://astralcodexten.substack.com/p/peer-review-request-carbon-costs", 69 + "https://astralcodexten.substack.com/p/open-thread-1855", 70 + "https://astralcodexten.substack.com/p/links-for-august", 71 + "https://astralcodexten.substack.com/p/kids-can-recover-from-missing-even", 72 + "https://astralcodexten.substack.com/p/open-thread-185", 73 + "https://astralcodexten.substack.com/p/blindness-schizophrenia-and-autism", 74 + "https://astralcodexten.substack.com/p/contra-hanania-on-partisanship", 75 + "https://astralcodexten.substack.com/p/open-thread-1845", 76 + "https://astralcodexten.substack.com/p/classifieds-thread-82021", 77 + "https://astralcodexten.substack.com/p/outdoor-careful-meetups-everywhere", 78 + "https://astralcodexten.substack.com/p/eight-hundred-slightly-poisoned-word", 79 + "https://astralcodexten.substack.com/p/open-thread-184", 80 + "https://astralcodexten.substack.com/p/contra-drum-on-the-fish-oil-story", 81 + "https://astralcodexten.substack.com/p/open-thread-1835", 82 + "https://astralcodexten.substack.com/p/details-of-the-infant-fish-oil-story", 83 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-acemoglu", 84 + "https://astralcodexten.substack.com/p/adumbrations-of-aducanumab", 85 + "https://astralcodexten.substack.com/p/what-should-we-make-of-sasha-chapins", 86 + "https://astralcodexten.substack.com/p/model-city-monday-8221", 87 + "https://astralcodexten.substack.com/p/open-thread-183", 88 + "https://astralcodexten.substack.com/p/updated-look-at-long-term-ai-risks", 89 + "https://astralcodexten.substack.com/p/when-does-worrying-about-things-trade", 90 + "https://astralcodexten.substack.com/p/contra-acemoglu-onoh-god-were-doing", 91 + "https://astralcodexten.substack.com/p/mantic-monday-726", 92 + "https://astralcodexten.substack.com/p/open-thread-182", 93 + "https://astralcodexten.substack.com/p/links-for-july", 94 + "https://astralcodexten.substack.com/p/open-thread-1815", 95 + "https://astralcodexten.substack.com/p/things-i-learned-writing-the-lockdown", 96 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-crazy", 97 + "https://astralcodexten.substack.com/p/peer-review-request-ketamine", 98 + "https://astralcodexten.substack.com/p/open-thread-181", 99 + "https://astralcodexten.substack.com/p/please-take-the-reader-survey", 100 + "https://astralcodexten.substack.com/p/open-thread-1805", 101 + "https://astralcodexten.substack.com/p/book-review-crazy-like-us", 102 + "https://astralcodexten.substack.com/p/reader-survey-final-check-in", 103 + "https://astralcodexten.substack.com/p/use-prediction-markets-to-fund-investigative", 104 + "https://astralcodexten.substack.com/p/open-thread-180", 105 + "https://astralcodexten.substack.com/p/book-review-contest-winners", 106 + "https://astralcodexten.substack.com/p/open-thread-1795", 107 + "https://astralcodexten.substack.com/p/is-this-predictive-coding", 108 + "https://astralcodexten.substack.com/p/lockdown-effectiveness-much-more", 109 + "https://astralcodexten.substack.com/p/model-city-monday", 110 + "https://astralcodexten.substack.com/p/open-thread-179", 111 + "https://astralcodexten.substack.com/p/open-thread-1785", 112 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-how", 113 + "https://astralcodexten.substack.com/p/welcome-polygenically-screened-babies", 114 + "https://astralcodexten.substack.com/p/book-review-how-asia-works", 115 + "https://astralcodexten.substack.com/p/open-thread-178", 116 + "https://astralcodexten.substack.com/p/open-thread-1775", 117 + "https://astralcodexten.substack.com/p/acx-reader-research-survey-call-for", 118 + "https://astralcodexten.substack.com/p/perpendicular-lives", 119 + "https://astralcodexten.substack.com/p/links-for-june", 120 + "https://astralcodexten.substack.com/p/mantic-monday-62121", 121 + "https://astralcodexten.substack.com/p/open-thread-177", 122 + "https://astralcodexten.substack.com/p/vote-in-the-book-review-contest", 123 + "https://astralcodexten.substack.com/p/your-book-review-plagues-and-peoples", 124 + "https://astralcodexten.substack.com/p/peer-review-lockdown-effectiveness", 125 + "https://astralcodexten.substack.com/p/open-thread-1765", 126 + "https://astralcodexten.substack.com/p/on-cerebralab-on-nuttcarhart-harris", 127 + "https://astralcodexten.substack.com/p/contra-smith-on-jewish-selective", 128 + "https://astralcodexten.substack.com/p/open-thread-176", 129 + "https://astralcodexten.substack.com/p/your-book-review-how-children-fail", 130 + "https://astralcodexten.substack.com/p/open-thread-1755", 131 + "https://astralcodexten.substack.com/p/your-book-review-down-and-out-in", 132 + "https://astralcodexten.substack.com/p/drug-users-use-a-lot-of-drugs", 133 + "https://astralcodexten.substack.com/p/i-will-not-eat-the-bugs", 134 + "https://astralcodexten.substack.com/p/instead-of-pledging-to-change-the", 135 + "https://astralcodexten.substack.com/p/open-thread-175", 136 + "https://astralcodexten.substack.com/p/your-book-review-wheres-my-flying", 137 + "https://astralcodexten.substack.com/p/your-book-review-the-collapse-of", 138 + "https://astralcodexten.substack.com/p/open-thread-1745", 139 + "https://astralcodexten.substack.com/p/you-have-a-terrible-track-record", 140 + "https://astralcodexten.substack.com/p/moral-costs-of-chicken-vs-beef", 141 + "https://astralcodexten.substack.com/p/what-do-treatments-for-accelerated", 142 + "https://astralcodexten.substack.com/p/open-thread-174", 143 + "https://astralcodexten.substack.com/p/your-book-review-humankind", 144 + "https://astralcodexten.substack.com/p/covid-suicides-much-more-than-you", 145 + "https://astralcodexten.substack.com/p/open-thread-1735", 146 + "https://astralcodexten.substack.com/p/reflections-on-greed-being-made-of", 147 + "https://astralcodexten.substack.com/p/peer-review-request-depression", 148 + "https://astralcodexten.substack.com/p/book-review-arabian-nights", 149 + "https://astralcodexten.substack.com/p/open-thread-173", 150 + "https://astralcodexten.substack.com/p/your-book-review-the-accidental-superpower", 151 + "https://astralcodexten.substack.com/p/links-for-may", 152 + "https://astralcodexten.substack.com/p/the-coldness-of-karen", 153 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-culture", 154 + "https://astralcodexten.substack.com/p/open-thread-172", 155 + "https://astralcodexten.substack.com/p/your-book-review-addiction-by-design", 156 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-cbt", 157 + "https://astralcodexten.substack.com/p/welcome-to-the-terrible-world-of", 158 + "https://astralcodexten.substack.com/p/theses-on-the-current-moment", 159 + "https://astralcodexten.substack.com/p/the-rise-and-fall-of-online-culture", 160 + "https://astralcodexten.substack.com/p/open-thread-171", 161 + "https://astralcodexten.substack.com/p/my-favorite-icd-10-codes", 162 + "https://astralcodexten.substack.com/p/your-book-review-the-years-of-lyndon", 163 + "https://astralcodexten.substack.com/p/your-book-review-through-the-eye", 164 + "https://astralcodexten.substack.com/p/why-is-it-hard-to-acknowledge-preferences", 165 + "https://astralcodexten.substack.com/p/book-review-a-brief-history-of-neoliberalism", 166 + "https://astralcodexten.substack.com/p/if-you-can-be-bad-you-can-also-be", 167 + "https://astralcodexten.substack.com/p/open-thread-170", 168 + "https://astralcodexten.substack.com/p/your-book-review-the-wizard-and-the", 169 + "https://astralcodexten.substack.com/p/your-book-review-double-fold", 170 + "https://astralcodexten.substack.com/p/nootropics-survey-2020-results", 171 + "https://astralcodexten.substack.com/p/verses-written-on-the-occasion-of", 172 + "https://astralcodexten.substack.com/p/mantic-monday-predictions-for-2021", 173 + "https://astralcodexten.substack.com/p/open-thread-169", 174 + "https://astralcodexten.substack.com/p/your-book-review-why-buddhism-is", 175 + "https://astralcodexten.substack.com/p/your-book-review-are-we-smart-enough", 176 + "https://astralcodexten.substack.com/p/book-review-global-economic-history", 177 + "https://astralcodexten.substack.com/p/no-really-why-are-so-many-christians", 178 + "https://astralcodexten.substack.com/p/mantic-monday-grading-my-trump-predictions", 179 + "https://astralcodexten.substack.com/p/open-thread-168", 180 + "https://astralcodexten.substack.com/p/georgist-cartoons-of-the-late-19thearly", 181 + "https://astralcodexten.substack.com/p/your-book-review-progress-and-poverty", 182 + "https://astralcodexten.substack.com/p/prospectus-on-prospera", 183 + "https://astralcodexten.substack.com/p/link-unifying-predictive-coding-with", 184 + "https://astralcodexten.substack.com/p/links-for-april", 185 + "https://astralcodexten.substack.com/p/from-the-rejects-pile-catch-22", 186 + "https://astralcodexten.substack.com/p/open-thread-167", 187 + "https://astralcodexten.substack.com/p/your-book-review-on-the-natural-faculties", 188 + "https://astralcodexten.substack.com/p/your-book-review-order-without-law", 189 + "https://astralcodexten.substack.com/p/metis-and-bodybuilders", 190 + "https://astralcodexten.substack.com/p/two-unexpected-multiple-hypothesis", 191 + "https://astralcodexten.substack.com/p/2020-predictions-calibration-results", 192 + "https://astralcodexten.substack.com/p/open-thread-166", 193 + "https://astralcodexten.substack.com/p/ambidexterity-and-cognitive-closure", 194 + "https://astralcodexten.substack.com/p/oh-the-places-youll-go-when-trying", 195 + "https://astralcodexten.substack.com/p/open-thread-165", 196 + "https://astralcodexten.substack.com/p/ask-me-anything", 197 + "https://astralcodexten.substack.com/p/towards-a-bayesian-theory-of-willpower", 198 + "https://astralcodexten.substack.com/p/more-antifragile-diversity-libertarianism", 199 + "https://astralcodexten.substack.com/p/book-review-antifragile", 200 + "https://astralcodexten.substack.com/p/adding-my-data-point-to-the-discussion", 201 + "https://astralcodexten.substack.com/p/open-thread-164", 202 + "https://astralcodexten.substack.com/p/book-review-the-new-sultan", 203 + "https://astralcodexten.substack.com/p/sleep-is-the-mate-of-death", 204 + "https://astralcodexten.substack.com/p/mantic-monday-mantic-matt-y", 205 + "https://astralcodexten.substack.com/p/open-thread-163", 206 + "https://astralcodexten.substack.com/p/richard-nixon-vs-cool", 207 + "https://astralcodexten.substack.com/p/trapped-priors-as-a-basic-problem", 208 + "https://astralcodexten.substack.com/p/the-consequences-of-radical-reform", 209 + "https://astralcodexten.substack.com/p/open-thread-162", 210 + "https://astralcodexten.substack.com/p/theyre-made-out-of-meta", 211 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-class", 212 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-march", 213 + "https://astralcodexten.substack.com/p/links-for-march", 214 + "https://astralcodexten.substack.com/p/shilling-for-big-mitochondria", 215 + "https://astralcodexten.substack.com/p/mantic-monday-scoring-rule-controversy", 216 + "https://astralcodexten.substack.com/p/open-thread-161", 217 + "https://astralcodexten.substack.com/p/bay-area-plant-based-meat-reviews", 218 + "https://astralcodexten.substack.com/p/a-modest-proposal-for-republicans", 219 + "https://astralcodexten.substack.com/p/book-review-fussell-on-class", 220 + "https://astralcodexten.substack.com/p/mantic-monday-judging-april-covid", 221 + "https://astralcodexten.substack.com/p/a-look-down-track-b", 222 + "https://astralcodexten.substack.com/p/open-thread-160", 223 + "https://astralcodexten.substack.com/p/movie-review-gabriel-over-the-white", 224 + "https://astralcodexten.substack.com/p/ezra-klein-on-vetocracy", 225 + "https://astralcodexten.substack.com/p/highlights-from-the-comments-on-cult", 226 + "https://astralcodexten.substack.com/p/book-review-the-cult-of-smart", 227 + "https://astralcodexten.substack.com/p/covidvitamin-d-much-more-than-you", 228 + "https://astralcodexten.substack.com/p/coronavirus-links-discussion-open", 229 + "https://astralcodexten.substack.com/p/statement-on-new-york-times-article", 230 + "https://astralcodexten.substack.com/p/the-precision-of-sensory-evidence", 231 + "https://astralcodexten.substack.com/p/list-of-fictional-cryptocurrencies", 232 + "https://astralcodexten.substack.com/p/ontology-of-psychiatric-conditions-653", 233 + "https://astralcodexten.substack.com/p/book-review-why-were-polarized", 234 + "https://astralcodexten.substack.com/p/metaculus-monday-2821", 235 + "https://astralcodexten.substack.com/p/open-thread-159", 236 + "https://astralcodexten.substack.com/p/journalism-and-legible-expertise", 237 + "https://astralcodexten.substack.com/p/webmd-and-the-tragedy-of-legible", 238 + "https://astralcodexten.substack.com/p/book-review-contest-final-rules", 239 + "https://astralcodexten.substack.com/p/ontology-of-psychiatric-conditions-34e", 240 + "https://astralcodexten.substack.com/p/riddle-of-the-sphinx-ii-sustained", 241 + "https://astralcodexten.substack.com/p/metaculus-monday", 242 + "https://astralcodexten.substack.com/p/open-thread-158", 243 + "https://astralcodexten.substack.com/p/technocracy-zilla-origins", 244 + "https://astralcodexten.substack.com/p/weyl-contra-me-on-technocracy", 245 + "https://astralcodexten.substack.com/p/contra-weyl-on-technocracy", 246 + "https://astralcodexten.substack.com/p/ontology-of-psychiatric-conditions", 247 + "https://astralcodexten.substack.com/p/know-your-amphetamines", 248 + "https://astralcodexten.substack.com/p/open-thread-157", 249 + "https://astralcodexten.substack.com/p/logistics", 250 + "https://astralcodexten.substack.com/p/still-alive", 251 + "https://astralcodexten.substack.com/p/youre-probably-wondering-why-ive", 252 + ] 253 + 254 + 255 + def check_mentions(api, keywords, since_id): 256 + logger.info("Retrieving mentions") 257 + new_since_id = since_id 258 + for tweet in tweepy.Cursor(api.mentions_timeline, since_id=since_id).items(): 259 + new_since_id = max(tweet.id, new_since_id) 260 + # logger.info(tweet) 261 + if tweet.in_reply_to_status_id is None: 262 + logger.error(f"not a reply") 263 + continue 264 + if tweet.user.screen_name != "__justplaying": 265 + logger.error(f"i only answer to alice") 266 + continue 267 + if any(keyword in tweet.text.lower() for keyword in keywords): 268 + logger.info(f"dispensing punishment") 269 + 270 + api.update_status( 271 + status="@elymitra_ " + random.sample(acx_articles, 1)[0], 272 + in_reply_to_status_id=tweet.id, 273 + auto_populate_reply_metadata=True, 274 + ) 275 + return new_since_id 276 + 277 + 278 + def main(): 279 + api = create_api() 280 + my_latest_tweet = api.user_timeline(screen_name="elybot_", count=1)[0] 281 + since_id = my_latest_tweet.id 282 + while True: 283 + since_id = check_mentions(api, ["!punish"], since_id) 284 + logger.info("Waiting...") 285 + time.sleep(30) 286 + 287 + 288 + if __name__ == "__main__": 289 + main()
+25
config.py
··· 1 + import tweepy 2 + import logging 3 + import os 4 + from dotenv import load_dotenv 5 + 6 + load_dotenv() 7 + logger = logging.getLogger() 8 + 9 + 10 + def create_api(): 11 + consumer_key = os.getenv("CONSUMER_KEY") 12 + consumer_secret = os.getenv("CONSUMER_SECRET") 13 + access_token = os.getenv("ACCESS_TOKEN") 14 + access_token_secret = os.getenv("ACCESS_TOKEN_SECRET") 15 + 16 + auth = tweepy.OAuthHandler(consumer_key, consumer_secret) 17 + auth.set_access_token(access_token, access_token_secret) 18 + api = tweepy.API(auth) 19 + try: 20 + api.verify_credentials() 21 + except Exception as e: 22 + logger.error("Error creating API", exc_info=True) 23 + raise e 24 + logger.info("API created") 25 + return api