Add formatting
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user