Compare commits
1 Commits
297a766aca
...
c6c387ea91
Author | SHA1 | Date |
---|---|---|
fluffy | c6c387ea91 |
10
beatbot.py
10
beatbot.py
|
@ -1,5 +1,7 @@
|
|||
import mastodon
|
||||
import random
|
||||
import requests
|
||||
import re
|
||||
|
||||
def randline(fname):
|
||||
with open(fname) as afile:
|
||||
|
@ -22,7 +24,13 @@ def bot():
|
|||
access_token='token.secret',
|
||||
api_base_url='https://botsin.space')
|
||||
|
||||
mdon.status_post(beats)
|
||||
query = requests.get(f'https://www.youtube.com/results?search_query={beats}')
|
||||
match = re.search(r'\?v=([^"]+)"', query.text)
|
||||
if match:
|
||||
beats += f'\n\nhttps://youtube.com/watch?v={match.group(1)}'
|
||||
|
||||
print(beats)
|
||||
#mdon.status_post(beats)
|
||||
|
||||
if __name__ == '__main__':
|
||||
bot()
|
||||
|
|
|
@ -140,7 +140,7 @@ python-versions = "*"
|
|||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "33cd2b69284ee759688156fe7c8d9ffe2c87151c5b090ba6f8d892a4b22a629a"
|
||||
content-hash = "8ee8ca988e50681b2b43c03d064ff31812170d326f87a71b23e13d6ed0bb86e4"
|
||||
|
||||
[metadata.files]
|
||||
blurhash = [
|
||||
|
|
|
@ -8,6 +8,7 @@ authors = ["fluffy <fluffy@beesbuzz.biz>"]
|
|||
python = "^3.8"
|
||||
"Mastodon.py" = "^1.5.1"
|
||||
wordfilter = "^0.2.6"
|
||||
requests = "^2.25.1"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
||||
|
|
Loading…
Reference in New Issue