Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 2 to 3 and updated gitignore #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CrickFev/scripts/lscorecard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


def getScoreCard(url,meta):
print("\n" + "*"*100)
print(("\n" + "*"*100))

r1 = requests.get(url)
soup = BS(r1.text,'html.parser')
Expand All @@ -37,7 +37,7 @@ def getScoreCard(url,meta):
(batsman_data[0])[4] +=" "*(4-len((batsman_data[0])[4]))
(batsman_data[0])[5] +=" "*(4-len((batsman_data[0])[5]))

print((batsman_data[0])[0]+"\t"+(batsman_data[0])[1]+"\t"+(batsman_data[0])[2]+"\t"+(batsman_data[0])[3]+"\t"+(batsman_data[0])[4]+"\t"+(batsman_data[0])[5])
print(((batsman_data[0])[0]+"\t"+(batsman_data[0])[1]+"\t"+(batsman_data[0])[2]+"\t"+(batsman_data[0])[3]+"\t"+(batsman_data[0])[4]+"\t"+(batsman_data[0])[5]))

#Print the Values of the Batsmen Playing
for j in range(1,3):
Expand All @@ -62,9 +62,9 @@ def getScoreCard(url,meta):
if len(sr)<4:
sr +=" "*(4-len(sr))

print(playerName + "\t"+playerScore+"\t"+ballsFaced+"\t"+fours+"\t"+six+"\t"+sr)
print((playerName + "\t"+playerScore+"\t"+ballsFaced+"\t"+fours+"\t"+six+"\t"+sr))

print("\n"+"*"*70)
print(("\n"+"*"*70))

if len((bowler_data[0])[0])<25:
(bowler_data[0])[0] +=" "*(25-len((bowler_data[0])[0]))
Expand All @@ -74,7 +74,7 @@ def getScoreCard(url,meta):
(bowler_data[0])[4] +=" "*(4-len((bowler_data[0])[4]))
(bowler_data[0])[5] +=" "*(4-len((bowler_data[0])[5]))

print((bowler_data[0])[0]+"\t"+(bowler_data[0])[1]+"\t"+(bowler_data[0])[2]+"\t"+(bowler_data[0])[3]+"\t"+(bowler_data[0])[4]+"\t"+(bowler_data[0])[5])
print(((bowler_data[0])[0]+"\t"+(bowler_data[0])[1]+"\t"+(bowler_data[0])[2]+"\t"+(bowler_data[0])[3]+"\t"+(bowler_data[0])[4]+"\t"+(bowler_data[0])[5]))

#Print the values of Bowlers data
for j in range(1,3):
Expand All @@ -94,7 +94,7 @@ def getScoreCard(url,meta):
wkt +=" "*(4-len(wkt))
eco +=" "*(4-len(eco))

print(name +"\t"+over+"\t"+maid+"\t"+runs+"\t"+wkt+"\t"+eco)
print((name +"\t"+over+"\t"+maid+"\t"+runs+"\t"+wkt+"\t"+eco))

@click.command()
@click.option('--em', nargs=2, type=int, help='first arg for event number and second for match')
Expand Down
14 changes: 7 additions & 7 deletions CrickFev/scripts/score.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from bs4 import BeautifulSoup
import urllib2
import cookielib
import urllib.request, urllib.error, urllib.parse
import http.cookiejar
from getpass import getpass
import sys
import time
Expand All @@ -12,7 +12,7 @@

def run():

cric=urllib2.urlopen("http://www.cricbuzz.com")
cric=urllib.request.urlopen("http://www.cricbuzz.com")

html=cric.read()

Expand All @@ -37,8 +37,8 @@ def run():
data = 'username=' + username + '&password=' + passwd + '&Submit=Sign+in'


cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
cj = http.cookiejar.CookieJar()
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))

opener.addheaders = [('User-Agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36')]

Expand All @@ -64,11 +64,11 @@ def run():

def cli():
global username
username = str(input("Enter Username: "))
username = str(eval(input("Enter Username: ")))
global passwd
passwd = getpass()
global number
number = str(input("Enter Mobile number: "))
number = str(eval(input("Enter Mobile number: ")))
while True:
run()
time.sleep(2*60)