Ejemplo n.º 1
0
class AppApp(MDApp):
    tennismatches = sports.get_sport(sports.TENNIS)
    tennistext = str(tennismatches)
    footballmatches = sports.get_sport(sports.SOCCER)
    footballtext = str(footballmatches)

    def build(self):
        self.theme_cls.theme_style = "Dark"
        self.screen = Builder.load_string(screen_helper)
        return self.screen
def get_scores(sport):
    if sport == 1:
        scores = sports.get_sport(sports.SOCCER)
    elif sport == 2:
        scores = sports.get_sport(sports.BASKETBALL)
    elif sport == 3:
        scores = sports.get_sport(sports.FOOTBALL)
    elif sport == 4:
        scores = sports.get_sport(sports.BASEBALL)

    if sport < 5:
        for score in scores:
            print(score)
Ejemplo n.º 3
0
def scraper(sport,listi,matche,team1,team2):
    m = 0
    
    
  

    
    matches = sports.get_sport(sport)
  
    stry = str (matches)
    stry = stry.split(",")  
   
    for i in stry :
        if "0-0" in i :
            listi.append(i)
       
            matche = str(listi).split("-")

   
    for i in matche:
        
        if m % 2 == 0 :
            
            team1.append(i)
        elif m % 2 != 0 :
            team2.append(i)
        m = m +1 
Ejemplo n.º 4
0
def football(request):
    if request.user.is_authenticated:
        return render(request,
                      template_name="main/football.html",
                      context={"football": sports.get_sport(sports.SOCCER)})
    else:
        return redirect("main:login")
Ejemplo n.º 5
0
def cricket(request):
    if request.user.is_authenticated:
        return render(request,
                      template_name="main/cricket.html",
                      context={"cricket": sports.get_sport(sports.CRICKET)})
    else:
        return redirect("main:login")
Ejemplo n.º 6
0
def basketball(request):
    if request.user.is_authenticated:
        return render(
            request,
            template_name="main/basketball.html",
            context={"basketball": sports.get_sport(sports.BASKETBALL)})
    else:
        return redirect("main:login")
Ejemplo n.º 7
0
def bkmatch():
    try:
        matches = sports.get_sport(sports.BASKETBALL)
        bdata = matches
    except Exception as exc:
        bdata = None

    return bdata
Ejemplo n.º 8
0
def cmatches():
    try:
        matches = sports.get_sport(sports.CRICKET)
        cdata = matches
    except Exception as exc:
        cdata = None

    return cdata
Ejemplo n.º 9
0
def smatch():
    try:
        matches = sports.get_sport(sports.SOCCER)
        sdata = matches
    except Exception as exc:
        sdata = None

    return sdata
Ejemplo n.º 10
0
def hmatch():
    try:
        matches = sports.get_sport(sports.HOCKEY)
        hdata = matches
    except Exception as exc:
        hdata = None

    return hdata
Ejemplo n.º 11
0
def tmatch():
    try:
        matches = sports.get_sport(sports.TENNIS)
        tdata = matches
    except Exception as exc:
        tdata = None

    return tdata
Ejemplo n.º 12
0
def respond(voice_data):
    if "football" in voice_data:
        speak.Speak("is it today match, odds , team or team points")
        if "today match" in voice_data:
            all_matches = sports.all_matches()
            football = all_matches[sports.FOOTBALL]
            speak.Speak(football)
        if "odds" in voice_data:
            speak.Speak("which match odds are you looking for")
            sports = sports.get_sport(sports.FOOTBALL)
            speak.Speak = (sports.ODDS, odd)
        if "odds" in voice_data:
            speak.Speak("which match points are you looking for")
            sports = sports.get_sport(sports.FOOTBALL)
            print = (sports.POINTS, points)
        else:
            if "team" in voice_data:
                speak.Speak("which team")
                voice_data = ''
                football = sports.get_team(sports.FOOTBALL, team)
                speak.Speak(football)
    else:
        if "tennis" in voice_data:
            speak.Speak("is it today match or player name or odds")
        if "today match" in voice_data:
            all_matches = sports.all_matches()
            tennis = all_matches[sports.TENNIS]
            speak.Speak(tennis)
        if "odds" in voice_data:
            speak.Speak("which match odds are you looking for")
            sports = sports.get_sport(sports.TENNIS)
            speak.Speak = (sports.ODDS, odd)
        else:
            if "player name" in voice_data:
                speak.Speak("which player")
                print("--------------")
                team = input("----")
                print("--------------")
                tennis = sports.get_team(sports.TENNIS, team)
                print(tennis)

    time.sleep(1)
    while 1:
        voice_data = record_audio()
        respond(voice_data)
Ejemplo n.º 13
0
    def get_all_basketball(self):  # montre tous les matchs en direct

        match_str = '               Live NBA Matches ' + str(
            datetime.datetime.now()) + '\n'

        try:
            matches = sports.get_sport(sports.BASKETBALL)
            self.text_widget.delete('1.0', END)
            self.s.set(match_str)
            self.text_widget.insert(INSERT, matches)
        except:
            print("Error")
Ejemplo n.º 14
0
async def ipl(ctx):
    matches = sports.get_sport(sports.CRICKET)
    for match in matches:
        if match.league == 'IND-IPL':
            if match.match_time == 'Match Finished':
                await ctx.send('abe saale abhi to koi game nahi chal raha hai')
                return
            embed = discord.Embed(title='IPL 2020',
                                  colour=discord.Colour.gold())
            embed.add_field(name=match.away_team,
                            value=match.away_score,
                            inline=False)
            embed.add_field(name=match.home_team,
                            value=match.home_score,
                            inline=False)
            await ctx.send(embed=embed)
            return
Ejemplo n.º 15
0
    def get_bundesliga_matches(self):  # montre tous les matchs en direct

        match_str = '               Live Bundesliga Matches ' + str(
            datetime.datetime.now()) + '\n'

        try:
            matches1 = sports.get_sport(sports.SOCCER)
            for item in matches1:
                match_all = str(item)
                for bundesliga_team in self.bundesliga_list:
                    if (bundesliga_team in match_all):
                        match_str += (match_all) + '\n'
                        self.bundesliga_team = bundesliga_team
                        break
            self.text_widget.delete('1.0', END)
            self.s.set(match_str)
            self.text_widget.insert(INSERT, self.s.get())
        except:
            print("Error")
Ejemplo n.º 16
0
    def get_spainsoccer_matches(self):  # montre tous les matchs en direct

        match_str = '               Live Liga BBVA Matches ' + str(
            datetime.datetime.now()) + '\n'

        try:
            matches2 = sports.get_sport(sports.SOCCER)
            for item in matches2:
                match_all = str(item)
                for spain_soccer_team in self.spain_soccer_list:
                    if (spain_soccer_team in match_all):
                        match_str += (match_all) + '\n'
                        self.spain_soccer_team = spain_soccer_team
                        break
            self.text_widget.delete('1.0', END)
            self.s.set(match_str)
            self.text_widget.insert(INSERT, self.s.get())
        except:
            print("Error")
Ejemplo n.º 17
0
    def get_premierleague_matches(self):  # montre tous les matchs en direct

        match_str = '               Live Premier League Matches ' + str(
            datetime.datetime.now()) + '\n'

        try:
            matches2 = sports.get_sport(sports.SOCCER)
            for item in matches2:
                match_all = str(item)
                for premierleague_team in self.premierleague_list:
                    if (premierleague_team in match_all):
                        match_str += (match_all) + '\n'
                        self.premierleague_team = premierleague_team
                        break
            self.text_widget.delete('1.0', END)
            self.s.set(match_str)
            self.text_widget.insert(INSERT, self.s.get())
        except:
            print("Error")
Ejemplo n.º 18
0
    def get_nba_matches(self):  # montre tous les matchs en direct

        match_str = '               Live NBA Matches ' + str(
            datetime.datetime.now()) + '\n'

        try:
            matches2 = sports.get_sport(sports.BASKETBALL)
            for item in matches2:
                match_all = str(item)
                for nba_team in self.nba_list:
                    if (nba_team in match_all):
                        match_str += (match_all) + '\n'
                        self.nba_team = nba_team
                        break
            self.text_widget.delete('1.0', END)
            self.s.set(match_str)
            self.text_widget.insert(INSERT, self.s.get())
        except:
            print("Error")
Ejemplo n.º 19
0
async def football(ctx, *args):
    if args == ():
        matches = sports.get_sport(sports.SOCCER)
        embed = discord.Embed(title='LIVE MATCHES',
                              colour=discord.Colour.blurple())
        for I in matches:
            embed.add_field(name=f'{I}', value=f'{I.league}')
        await ctx.send(embed=embed)
        return
    try:
        match = sports.get_match(sports.SOCCER, args[0], args[2])
    except:
        await ctx.send('abe shuru to hone do')
        return
    embed = discord.Embed(title=' '.join(args).upper(),
                          colour=discord.Colour.blurple())
    embed.description = f'{match.league}'
    embed.add_field(name=f'{match.away_team}', value=f'{match.away_score}')
    embed.add_field(name=f'{match.home_team}', value=f'{match.home_score}')
    await ctx.send(embed=embed)
Ejemplo n.º 20
0
def cricket(ch):
    matchinfo = sports.get_sport("CRICKET")
    Notification(title="Live Cricket score updates Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 21
0
 def test_sport(self):
     self.assertEqual(self.hockey_match.sport, sports.HOCKEY)
     self.assertIsNotNone(sports.get_sport(sports.SOCCER))
Ejemplo n.º 22
0
import sports
from pynotifier import Notification

Matchinfo = sports.get_sport("CRICKET")
Notification(title="IPL live score update",
             description=str(Matchinfo),
             duration=120).send()
Ejemplo n.º 23
0
def basketball(ch):
    matchinfo = sports.get_sport("BASKETBALL")
    Notification(title="Live Basketball score updates from Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 24
0
def Soccer(ch):
    matchinfo = sports.get_sport("SOCCER")
    Notification(title="Live Soccer score updates from Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 25
0
def Tennis(ch):
    matchinfo = sports.get_sport("TENNIS")
    Notification(title="Live Tennis score updates from Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 26
0
def hockey(ch):
    matchinfo = sports.get_sport("HOCKEY")
    Notification(title="Live HOCKEY score updates Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 27
0
def football(ch):
    matchinfo = sports.get_sport("FOOTBALL")
    Notification(title="Live Football score updates Lucifer-1010",
                 description=str(matchinfo),
                 duration=60).send()
Ejemplo n.º 28
0
import sports

#Live Matched
all_matches = sports.all_matches()
baseball = all_matches['cricket']
print(baseball)

#Live Matched
matches = sports.get_sport(sports.CRICKET)
print(matches)

#Football Live
football = sports.get_sport(sports.FOOTBALL)
print(football)

#basketabbl

basktetball = sports.get_sport(sports.BASKETBALL)
print(basktetball)
Ejemplo n.º 29
0
def get_scores(sport):
    if sport == 1:
        scores = sports.get_sport(sports.FOOTBALL)

    elif sport == 2:
        scores = sports.get_sport(sports.SOCCER)
    elif sport == 3:
        scores = sports.get_sport(sports.BASKETBALL)
    elif sport == 4:
        scores = sports.get_sport(sports.BASEBALL)
    elif sport == 5:
        scores = sports.get_sport(sports.HOCKEY)
    elif sport == 6:
        scores = sports.get_sport(sports.TENNIS)
    elif sport == 7:
        scores = sports.get_sport(sports.RUGBY_L)
    elif sport == 8:
        scores = sports.get_sport(sports.VOLLEYBALL)
    elif sport == 9:
        scores = sports.get_sport(sports.CRICKET)
    elif sport == 10:
        scores = sports.get_sport(sports.HANDBALL)
    elif sport == 11:
        scores = sports.get_sport(sports.RUGBY_U)
    elif sport == 12:  # this is for specific teams
        team_name = str(input("Type the name of a baseball team: "))
        team_data = sports.get_team("baseball", team_name)
    elif sport == 13:  # this is for specific teams
        team_name = str(input("Type the name of a football team: "))
        team_data = sports.get_team("football", team_name)
    elif sport == 14:  # this is for specific teams
        team_name = str(input("Type the name of a hockey team: "))
        team_data = sports.get_team("hockey", team_name)
    elif sport == 15:  # this is for specific teams
        team_name = str(input("Type the name of a basketball team: "))
        team_data = sports.get_team("basketball", team_name)

    if sport < 12:  # if it is just a sport
        for score in scores:
            print(score)
    else:
        print(team_data)
Ejemplo n.º 30
0
def get_baseball():
    matches = sports.get_sport(sports.BASEBALL)
    return matches