Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -306,23 +306,28 @@ def nasa_sdo_composite(obj,size,date1,date2):
|
|
306 |
link_box=[]
|
307 |
soup = bs4.BeautifulSoup(feed1.content, 'html.parser')
|
308 |
anchor_elements = soup.find_all('a')
|
309 |
-
anchor_elements.sort()
|
310 |
cnt=0
|
311 |
max_cnt=4
|
312 |
for element in anchor_elements:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
if cnt<=max_cnt:
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
for s in size:
|
318 |
-
ls=href.split("_")
|
319 |
-
print(ls[1][0:4])
|
320 |
-
print(date1[8:13])
|
321 |
-
if ls[1][0:4]>=date1[8:13]:
|
322 |
-
src_obj=ls[3].split('.jpg')[0]
|
323 |
-
if src_obj == o:
|
324 |
-
if int(ls[2]) == int(s):
|
325 |
-
html_in+=f'<div class="img_class_sdo"><a href="{sdo_source_format}{href}" target="_blank">{href}</a><br><img src={sdo_source_format}{href}></div>'
|
326 |
html_in+="</div>"
|
327 |
return html_in
|
328 |
|
|
|
306 |
link_box=[]
|
307 |
soup = bs4.BeautifulSoup(feed1.content, 'html.parser')
|
308 |
anchor_elements = soup.find_all('a')
|
309 |
+
#anchor_elements.sort()
|
310 |
cnt=0
|
311 |
max_cnt=4
|
312 |
for element in anchor_elements:
|
313 |
+
href=element.get('href')
|
314 |
+
if href.endswith('.jpg'):
|
315 |
+
for o in obj:
|
316 |
+
for s in size:
|
317 |
+
ls=href.split("_")
|
318 |
+
print(ls[1][0:4])
|
319 |
+
print(date1[8:13])
|
320 |
+
if ls[1][0:4]>=date1[8:13]:
|
321 |
+
src_obj=ls[3].split('.jpg')[0]
|
322 |
+
if src_obj == o:
|
323 |
+
if int(ls[2]) == int(s):
|
324 |
+
link_box.append(href)
|
325 |
+
link_box.sort()
|
326 |
+
for ea in link_box:
|
327 |
if cnt<=max_cnt:
|
328 |
+
cnt+=1
|
329 |
+
html_in+=f'<div class="img_class_sdo"><a href="{sdo_source_format}{ea}" target="_blank">{href}</a><br><img src={sdo_source_format}{ea}></div>'
|
330 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
html_in+="</div>"
|
332 |
return html_in
|
333 |
|