Skip to content

Commit 74de5a3

Browse files
Add files via upload
1 parent 065cd2d commit 74de5a3

File tree

13 files changed

+303
-64
lines changed

13 files changed

+303
-64
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"colorValue": "#e6e6fa",
3-
"from": "hex",
4-
"to": "name"
2+
"colorValue": "blue",
3+
"from": "name",
4+
"to": "hex"
55
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"equation": ""
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"phoneNumber": "+13307210153"
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"searched": "cat",
3+
"src_type": "img"
4+
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"path": "/WebServerAI/build/tables/templates/pricing2.html",
3+
"outputPath": "/WebServerAI/build/tables/pricing-table.html",
4+
"data": {
5+
"free_plan": "Free",
6+
"free_amount": "Free",
7+
"free_link": "#",
8+
"free_description": "Free plan",
9+
"free_items": [
10+
{
11+
"name": "5 Websites",
12+
"access": true
13+
},
14+
{
15+
"name": "1 User",
16+
"access": true
17+
},
18+
{
19+
"name": "100MB Space/website",
20+
"access": true
21+
},
22+
{
23+
"name": "Continuous Deployment",
24+
"access": false
25+
},
26+
{
27+
"name": "No priority support",
28+
"access": false
29+
}
30+
],
31+
"standard_plan": "Standard",
32+
"standard_amount": "$200",
33+
"standard_per": "year",
34+
"standard_link": "#",
35+
"standard_description": "Standard plan",
36+
"standard_items": [
37+
{
38+
"name": "25 Websites",
39+
"access": true
40+
},
41+
{
42+
"name": "5 Users",
43+
"access": true
44+
},
45+
{
46+
"name": "500MB Space/website",
47+
"access": true
48+
},
49+
{
50+
"name": "Continuous Deployment",
51+
"access": true
52+
},
53+
{
54+
"name": "No priority support",
55+
"access": false
56+
}
57+
],
58+
"pro_plan": "Pro",
59+
"pro_amount": "$500",
60+
"pro_per": "year",
61+
"pro_link": "#",
62+
"pro_description": "Pro plan",
63+
"pro_items": [
64+
{
65+
"name": "Unlimited Websites",
66+
"access": true
67+
},
68+
{
69+
"name": "20 Users",
70+
"access": true
71+
},
72+
{
73+
"name": "10GB Space/website",
74+
"access": true
75+
},
76+
{
77+
"name": "Continuous Deployment",
78+
"access": true
79+
},
80+
{
81+
"name": "Email support",
82+
"access": true
83+
}
84+
],
85+
"enterprise_plan": "Enterprise",
86+
"enterprise_amount": "Contact us",
87+
"enterprise_link": "#",
88+
"enterprise_items": [
89+
{
90+
"name": "Unlimited Websites",
91+
"access": true
92+
},
93+
{
94+
"name": "Unlimited Users",
95+
"access": true
96+
},
97+
{
98+
"name": "Unlimited Users",
99+
"access": true
100+
},
101+
{
102+
"name": "Unlimited Space/website",
103+
"access": true
104+
},
105+
{
106+
"name": "Continuous Deployment",
107+
"access": true
108+
},
109+
{
110+
"name": "24/7 Email Support",
111+
"access": true
112+
}
113+
]
114+
}
115+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"textToTranslate": "Hello World!",
3+
"translateFrom": "auto",
4+
"translateTo": "en"
5+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"text": "Work collars, a ubiquitous feature of many professional attires, \n serve as a subtle yet essential component in defining one's occupational identity. \n These rigid, structured necklines not only provide a polished, \n tailored appearance but also carry deeper symbolic meaning. \n The crisp white collar of a button-down shirt, for instance, evokes a sense of formality and authority, \n instantly conveying the wearer's status as a white-collar professional engaged in office-based, cerebral work. \n Conversely, the rugged, reinforced collar of a mechanic's coverall signals hands-on, blue-collar labor, \n the durable fabric and stitching a testament to the demanding physical nature of the job. \n Even the loosened, open collar of a service industry uniform suggests a more casual, customer-facing role.\n Beyond the visual cues, work collars also serve functional purposes, offering structure, support and protection depending\n on the demands of the occupation. \n The stiff, high-necked collar of a lab coat shields the wearer from potential chemical splashes, while the flexible, \n breathable collar of an athletic jersey facilitates mobility and airflow during physical activity. \n In this way, work collars have evolved as a sartorial shorthand, immediately conveying the wearer's profession, \n status and role within the broader workforce, their simple design belying the complex social and functional \n meanings they embody.",
3-
"length": 0.2
2+
"text": "The scope of IT is truly staggering, spanning hardware engineering, software development, network administration, cybersecurity, data analysis, and much more. IT professionals are the highly-skilled technicians, programmers, and innovators who design, implement, and maintain the complex systems that power our digital society. Their work involves everything from writing code for cutting-edge applications to configuring and securing the networks that transmit our data around the world. Beyond the mechanics of computing, IT also drives innovation and progress in countless industries. From revolutionizing healthcare with electronic medical records and robotic surgery, to enabling the rise of e-commerce and the sharing economy, the transformative power of information technology is reshaping how we live, work, and interact. As new technologies like artificial intelligence, the Internet of Things, and quantum computing continue to emerge, the influence of IT will only grow, making it an increasingly vital and exciting field for those with the passion and aptitude to be a part of it.",
3+
"sentences": 5
44
}

WebServerAI/scripts/mathML.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! C:\xampp\htdocs\WebServerAI\.venv\Scripts\python.exe
2+
import latex2mathml.converter, json, os, re
3+
from sympy import *
4+
5+
currentPath = os.path.join(os.getcwd(), "data", "mathML.json")
6+
with open(currentPath) as json_file:
7+
data=json.load(json_file)
8+
try:
9+
sympify_exp = parse_expr(data['equation'])
10+
latex_equ = latex(sympify_exp)
11+
mathml = latex2mathml.converter.convert(latex_equ)
12+
print("Content-Type: application/json\n")
13+
print(json.dumps({'mathml':mathml, 'latex':latex_equ}))
14+
except Exception as e:
15+
print("Content-Type: application/json\n")
16+
print(json.dumps({'error':str(e)}))

WebServerAI/scripts/phonenumber.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#! C:\xampp\htdocs\WebServerAI\.venv\Scripts\python.exe
2+
import phonenumbers, json, os
3+
from phonenumbers import timezone, geocoder, carrier;
4+
from phonenumbers.phonenumberutil import number_type;
5+
6+
currentPath = os.getcwd()+"/data/phonenumber.json"
7+
with open(currentPath) as json_file:
8+
data=json.load(json_file)
9+
10+
11+
12+
phoneNumberResults = {}
13+
14+
try:
15+
number = phonenumbers.parse(data['phoneNumber'],None)
16+
if(phonenumbers.is_valid_number(number)==False):
17+
phoneNumberResults['error'] = "Invalid phone number"
18+
except phonenumbers.NumberParseException as e:
19+
phoneNumberResults["error"] = e
20+
21+
def numTypeName(num: int)->str:
22+
results = ''
23+
match num:
24+
case 0:
25+
results = 'FIXED_LINE'
26+
case 1:
27+
results = 'MOBILE'
28+
case 2:
29+
results = 'FIXED_LINE_OR_MOBILE'
30+
case 3:
31+
results = 'TOLL_FREE'
32+
case 4:
33+
results = 'PREMIUM_RATE'
34+
case 5:
35+
results = 'SHARED_COST'
36+
case 6:
37+
results = 'VOIP'
38+
case 7:
39+
results = 'PERSONAL_NUMBER'
40+
case 8:
41+
results = 'PAGER'
42+
case 9:
43+
results = 'UAN'
44+
case 10:
45+
results = 'VOICEMAIL'
46+
case _:
47+
results = 'UNKNOWN'
48+
return results
49+
def numType(number: str, getName:bool=False)->str|int:
50+
return (number_type(number) if not getName else numTypeName(number_type(number)))
51+
52+
53+
if 'error' not in phoneNumberResults:
54+
phoneNumberResults['phoneNumber'] = phonenumbers.format_number(number, phonenumbers.PhoneNumberFormat.E164)
55+
phoneNumberResults['possible_num'] = phonenumbers.is_possible_number(number)
56+
phoneNumberResults['is_valid'] = phonenumbers.is_valid_number(number)
57+
phoneNumberResults['country_code'] = number.country_code
58+
phoneNumberResults['national_num'] = number.national_number
59+
phoneNumberResults['extensions'] = (number.extension if number.extension!=None else "")
60+
phoneNumberResults['timezone'] = timezone.time_zones_for_number(number)
61+
phoneNumberResults['location'] = geocoder.description_for_number(number, 'en')
62+
phoneNumberResults['provider'] = carrier.name_for_number(number, 'en')
63+
phoneNumberResults['is_mobile'] = (True if numType(number)==1 else False)
64+
phoneNumberResults['type'] = numType(number, True)
65+
print("Content-Type: application/json\n")
66+
print(json.dumps(phoneNumberResults))

WebServerAI/scripts/srcCapture.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! C:\xampp\htdocs\WebServerAI\.venv\Scripts\python.exe
2+
import json, os, requests, urllib, html, re
3+
from bs4 import BeautifulSoup
4+
5+
def removeSVG(url):
6+
svg_url_pattern = r'^https?://.*\.svg$'
7+
return not re.match(svg_url_pattern, url)
8+
9+
def checkValidURL(url):
10+
try:
11+
response = urllib.request.urlopen(url)
12+
return response.getcode() == 200
13+
except urllib.error.URLError:
14+
return False # Error
15+
currentPath = os.getcwd()+"/data/srcCapture.json"
16+
with open(currentPath) as json_file:
17+
data=json.load(json_file)
18+
search_term = data['searched'].replace(' ','+')
19+
srcType = data['src_type']
20+
if(srcType.lower()=='img'):
21+
url = f'https://google.com/search?q={search_term}&udm=2'
22+
23+
response = requests.get(url)
24+
soup = BeautifulSoup(response.content, 'html.parser',from_encoding='utf-8')
25+
26+
images = soup.select('img')
27+
if(search_term!=''):
28+
image_urls = [img.get('src') for img in images]
29+
image_urls.pop(0)
30+
else:
31+
image_urls = []
32+
image_urls = list(filter(removeSVG,image_urls))
33+
image_urls = list(filter(checkValidURL,image_urls))
34+
print("Content-Type: application/json\n")
35+
print(json.dumps({'img_urls':image_urls}))

0 commit comments

Comments
 (0)