CogSphere / ccogsphere.py
CognitiveScience's picture
Update ccogsphere.py
c49bc9d
raw
history blame
563 Bytes
from bs4 import BeautifulSoup
import requests
def ccs(inp):
inp1=inp.split(":")[0]
if (inp1=="https"):
response = requests.get(inp)
soup = BeautifulSoup(response.text, "html.parser")
result=response.text[response.text.find("viewCount"):].split('"')[2]
else:
if(inp1=="End"):
result=result + " The " + inp1
else:
if (inp1=="Start"):
result="Start" + "\n"
else:
result+=inp1 + " Picked " + inp.split(":")[1] + "\n"
return result