You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB
Python

import sys
import html5lib # html5lib is a Python package that implements the HTML5 parsing algorithm
import xml.etree.ElementTree as ET
import requests
import urllib.request
from urllib.request import urlopen
from urllib.error import HTTPError
from urllib.parse import urljoin, urlparse, urlunparse
import os, sys
from urllib.request import urlopen
from bs4 import BeautifulSoup
from bs4 import BeautifulSoup, SoupStrainer
import time
print('''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="reset.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<header>''')
for line in sys.stdin:
line = line.rstrip()
href, code, msg = line.split(" ", 2)
# print(href, code, msg)
if code == '200':
print('<p> <a href="{}"> {} </a> </p>'.format(href, href))
else:
print('<p> <a href="{}"> {} </a> <img width=30px src="https://imgur.com/rEO5Aq2.png" alt="RIP LINK"> </p>'.format(href, href))
print('''</body>
</html>''')