Add formatting

This commit is contained in:
Tobias Eidelpes
2021-05-03 10:03:20 +02:00
parent 2442b1326f
commit cee89867f2
3 changed files with 12 additions and 32 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ from app_be.models import Tweet, Feed
# Register your models here.
admin.site.register(Tweet)
admin.site.register(Feed)
admin.site.register(Feed)
+8 -7
View File
@@ -25,20 +25,21 @@ class twitter_bot(threading.Thread):
if posted:
break
#load feed
# load feed
feeds = search(feed.url)
#search single posts
# search single posts
for current in feeds:
print(current)
#TODO: split keywords and search
#looking for keywords
# TODO: split keywords and search
# split_keywords = [x.strip() for x in feed.keywords.split(',')]
# looking for keywords
if feed.keywords in current.title:
if posted:
break
#preparing tweet
# preparing tweet
new_tweet = Tweet()
new_tweet.icon = None
new_tweet.text = current.title
@@ -51,8 +52,8 @@ class twitter_bot(threading.Thread):
print("Posting update on Twitter")
print(new_tweet)
#TODO: uncomment
#twitter_api.post_update(new_tweet.text, new_tweet.url)
# TODO: uncomment
# twitter_api.post_update(new_tweet.text, new_tweet.url)
new_tweet.save()
posted = True