diff --git a/app/routes.py b/app/routes.py index 93816a8..b80fd6a 100644 --- a/app/routes.py +++ b/app/routes.py @@ -163,16 +163,14 @@ def search(): parsedResults = [] if form.validate_on_submit(): user = form.username.data - if isTwitterUser(user): - r = requests.get("{instance}search?f=users&q={usern}".format(instance=nitterInstance, usern=user)) - html = BeautifulSoup(str(r.content), "lxml") - results = html.body.find_all('a', attrs={'class':'tweet-link'}) - + r = requests.get("{instance}search?f=users&q={usern}".format(instance=nitterInstance, usern=user.replace(" ", "+"))) + html = BeautifulSoup(str(r.content), "lxml") + results = html.body.find_all('a', attrs={'class':'tweet-link'}) + if results: parsedResults = [s['href'].replace("/", "") for s in results] - return render_template('search.html', form = form, results = parsedResults) else: - flash("User {} does not exist!".format(user)) + flash("User {} not found...".format(user)) return render_template('search.html', form = form, results = parsedResults) else: return render_template('search.html', form = form) diff --git a/app/templates/_post.html b/app/templates/_post.html index 21e4089..8b462df 100644 --- a/app/templates/_post.html +++ b/app/templates/_post.html @@ -6,7 +6,7 @@ -
{{ post.op }}
+
{{ post.op }}
{{post.date}} {{post.username}} retwitted diff --git a/app/templates/_post_nort.html b/app/templates/_post_nort.html index 6770461..062fc16 100644 --- a/app/templates/_post_nort.html +++ b/app/templates/_post_nort.html @@ -6,7 +6,7 @@
-
{{ post.op }}
+
{{ post.op }}
{{post.date}} {% if post.isPinned %}