feat: Add new calculators for acres to square feet, angstroms to nanometers, apothecary ounces to grams, astronomical units to light years, and atmosphere to mmHg, and update the backlog.
This commit is contained in:
19
get_107.py
Normal file
19
get_107.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import urllib.request
|
||||
import json
|
||||
import base64
|
||||
|
||||
url_base = "https://howdoyouconvert.com/wp-json/wp/v2/calculator/107?context=edit"
|
||||
creds = base64.b64encode(b"ben:6YGf wVxu gBpz pkqx BGZO lfVP").decode("utf-8")
|
||||
headers = {
|
||||
"Authorization": "Basic " + creds,
|
||||
"User-Agent": "Mozilla/5.0"
|
||||
}
|
||||
|
||||
req = urllib.request.Request(url_base, headers=headers)
|
||||
try:
|
||||
resp = urllib.request.urlopen(req)
|
||||
data = json.loads(resp.read().decode("utf-8"))
|
||||
print(data['content']['raw'])
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
if hasattr(e, 'read'): print("Response:", e.read().decode("utf-8"))
|
||||
Reference in New Issue
Block a user