From 5d94b677a8cd12e587afb10d8bc07e6fb8d9ba9a Mon Sep 17 00:00:00 2001 From: pluja Date: Thu, 27 Aug 2020 12:27:17 +0200 Subject: [PATCH] Improve 'following' UI --- app/routes.py | 2 -- app/templates/following.html | 48 ++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/app/routes.py b/app/routes.py index 572d4a6..aa17784 100644 --- a/app/routes.py +++ b/app/routes.py @@ -150,7 +150,6 @@ def following(): @login_required def search(): form = SearchForm() - parsedResults = [] if form.validate_on_submit(): user = form.username.data results = twitterUserSearch(user) @@ -604,7 +603,6 @@ def getPosts(account): def getYoutubePosts(ids): videos = [] - ydl = YoutubeDL() with FuturesSession() as session: futures = [session.get('https://www.youtube.com/feeds/videos.xml?channel_id={id}'.format(id=id.channelId)) for id in ids] for future in as_completed(futures): diff --git a/app/templates/following.html b/app/templates/following.html index 44d9957..954d741 100644 --- a/app/templates/following.html +++ b/app/templates/following.html @@ -1,35 +1,29 @@ {% extends "base.html" %} {% block content %} -
-
- -
-
-

Accounts you follow ({{ count }}):

-
-
-
+
+
+

Following ({{ count }}):

+
-
-
- {% for acc in accounts %} -
-
-

-

- {{ form.hidden_tag() }} - {{ form.submit(value='Unfollow') }} -
-

-
- -
- {{acc.username}} -
+
+ {% for acc in accounts %} +
+
+

+

+ {{ form.hidden_tag() }} + {{ form.submit(value='Unfollow') }} +
+

+
+
+ {{acc.username}} +
@{{acc.username}}
+
+
+ {% endfor %}
- {% endfor %} -
{% endblock %} \ No newline at end of file