Fixed: spaces breaking twitter search
This commit is contained in:
parent
a5a8b78ba2
commit
b06f96f9c4
@ -471,7 +471,8 @@ def isTwitterUser(username):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def twitterUserSearch(terms):
|
def twitterUserSearch(terms):
|
||||||
response = urllib.request.urlopen('{instance}search?f=users&q={user}'.format(instance=nitterInstance, user=terms)).read()
|
|
||||||
|
response = urllib.request.urlopen('{instance}search?f=users&q={user}'.format(instance=nitterInstance, user=urllib.parse.quote(terms))).read()
|
||||||
html = BeautifulSoup(str(response), "lxml")
|
html = BeautifulSoup(str(response), "lxml")
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
@ -531,13 +532,14 @@ def getFeed(urls):
|
|||||||
userFeed = html.find_all('div', attrs={'class':'timeline-item'})
|
userFeed = html.find_all('div', attrs={'class':'timeline-item'})
|
||||||
if userFeed != []:
|
if userFeed != []:
|
||||||
for post in userFeed[:-1]:
|
for post in userFeed[:-1]:
|
||||||
|
date_time_str = post.find('span', attrs={'class':'tweet-date'}).find('a')['title'].replace(",","")
|
||||||
|
time = datetime.datetime.now() - datetime.datetime.strptime(date_time_str, '%d/%m/%Y %H:%M:%S')
|
||||||
|
if time.days >= 11:
|
||||||
|
continue
|
||||||
|
|
||||||
if post.find('div', attrs={'class':'pinned'}):
|
if post.find('div', attrs={'class':'pinned'}):
|
||||||
if post.find('div', attrs={'class':'pinned'}).find('span', attrs={'icon-pin'}):
|
if post.find('div', attrs={'class':'pinned'}).find('span', attrs={'icon-pin'}):
|
||||||
continue
|
continue
|
||||||
date_time_str = post.find('span', attrs={'class':'tweet-date'}).find('a')['title'].replace(",","")
|
|
||||||
time = datetime.datetime.now() - datetime.datetime.strptime(date_time_str, '%d/%m/%Y %H:%M:%S')
|
|
||||||
if time.days >= 14:
|
|
||||||
continue
|
|
||||||
|
|
||||||
newPost = twitterPost()
|
newPost = twitterPost()
|
||||||
newPost.op = post.find('a', attrs={'class':'username'}).text
|
newPost.op = post.find('a', attrs={'class':'username'}).text
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
.video-js-responsive-container.vjs-hd {
|
||||||
|
padding-top: 56.25%;
|
||||||
|
}
|
||||||
|
.video-js-responsive-container.vjs-sd {
|
||||||
|
padding-top: 75%;
|
||||||
|
}
|
||||||
|
.video-js-responsive-container {
|
||||||
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.video-js-responsive-container .video-js {
|
||||||
|
height: 100% !important;
|
||||||
|
width: 100% !important;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.para-light-grey{
|
.para-light-grey{
|
||||||
background-color: rgb(250, 82, 82);
|
background-color: rgb(250, 82, 82);
|
||||||
}
|
}
|
||||||
|
@ -4,13 +4,15 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="ui text container">
|
<div class="ui text container">
|
||||||
<video class="video-js vjs-default-skin"
|
<div class="video-js-responsive-container vjs-hd">
|
||||||
data-setup='{ "playbackRates": [0.5, 1, 1.25,1.5, 2] }'
|
<video class="video-js vjs-default-skin"
|
||||||
width="720%"
|
data-setup='{ "playbackRates": [0.5, 1, 1.25,1.5, 2] }'
|
||||||
controls
|
width="1080"
|
||||||
preload="auto">
|
controls
|
||||||
|
preload="auto">
|
||||||
<source src="/stream?v={{video.id}}" type="video/mp4">
|
<source src="/stream?v={{video.id}}" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="ui segments">
|
<div class="ui segments">
|
||||||
<div class="ui segment">
|
<div class="ui segment">
|
||||||
|
Reference in New Issue
Block a user