Code Monkey home page Code Monkey logo

chatgpt_sports_betting_bot's Introduction

ChatGPT Sports Betting Bot

This is the code for the "ChatGPT Sports Betting Bot" Video by Siraj Raval on Youtube. This repository is a starter template for you to build your own sports betting bot.

Setup Instructions (easy mode)

If you just want to run a sports betting bot in the cloud without having to install any dependencies or deploy your own version, run either of the two colab notebooks below.

  1. Version 1: Arbitrage Bot
  2. Version 2: Deep Learning Bot

And get API keys from

Make Bets with Predictions here:

Setup Instructions (hard mode)

If you want to deploy your own sports betting bot and have it make predictions consistently, follow the setup instructions below to initialize your firebase app template for vercel deployment. The app still needs to fetch predictions from the python back-end and display it on the react front end, I just did it manually for the video. It also doesn't yet make bets programmatically, I have to do that manually. It was difficult for me to find a programmatic betting API.

Credits

Ryankrumenacker, kyleskom, React Native Market, OpenAI, Twitter

How to use

  1. Download or clone this repo.

  2. Install dependencies.

npm install
// or
yarn install
  1. Go to src/core/config.js and replace FIREBASE_CONFIG with your own firebase config.
export const FIREBASE_CONFIG = {
  apiKey: 'xxx-yyy-zzz', // etc.
  // rest of your firebase config
}
  1. Turn on Google and Facebook Providers inside your Firebase Project: providers

  2. Google Sign In configuration:

    1. Follow official Expo docs on Google Sign In: https://docs.expo.io/versions/latest/sdk/google/#using-it-inside-of-the-expo-app
    2. Go to src/core/config.js and replace ANDROID_GOOGLE_CLIENT_ID and IOS_GOOGLE_CLIENT_ID with your own generated IDs.
    3. Before submitting your app to Google Play, make sure to follow these docs: https://docs.expo.io/versions/latest/sdk/google/#deploying-to-a-standalone-app-on-android
    4. Before submitting your app to App Store, make sure to follow these docs: https://docs.expo.io/versions/latest/sdk/google/#deploying-to-a-standalone-app-on-ios
  3. Facebook Login configuration:

    1. Follow official Expo docs on Facebook Login: https://docs.expo.io/versions/latest/sdk/facebook/#registering-your-app-with-facebook
    2. Go to app.json and replace facebookScheme, facebookAppId and facebookDisplayName with your own generated IDs/names.
  4. Run project on iOS / Android.

 npm run ios // npm run android
 // or
 yarn ios // yarn android

Preview

start login register forgot home drawer profile

chatgpt_sports_betting_bot's People

Contributors

llsourcell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt_sports_betting_bot's Issues

Twitter Auth isses - Colab

`## Add Twitter Sentiment Analysis
import tweepy
from textblob import TextBlob

Authenticate with Twitter API

consumer_key = 'x1ImslwHENof8RIstPS6itXtFQ'
consumer_secret = 'OJgsR3xnITHPTMUx7qEfvp3d1Zwoa9tpW6lb6YBBC5Q1eAEoO5'
access_token = '944784851915304960-0aZ9wT0h2r3UZl1nC6C727a1LueSYoT'
access_token_secret = 'E22wQCMRkZ2NXgk6358KChra8R5njzAou0blkB8QLOVkR'

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

Search for tweets about the Warriors

warriors_tweets = tweepy.Cursor(api.search, q='#Brooklyn Nets').items(100)

Perform sentiment analysis on tweets

positive_tweets = 0
negative_tweets = 0
neutral_tweets = 0

for tweet in warriors_tweets:
analysis = TextBlob(tweet.text)
if analysis.sentiment.polarity > 0:
positive_tweets += 1
elif analysis.sentiment.polarity < 0:
negative_tweets += 1
else:
neutral_tweets += 1

Print results

print("Positive tweets: ", positive_tweets)
print("Negative tweets: ", negative_tweets)
print("Neutral tweets: ", neutral_tweets)

##if positive_tweets > negative_tweets:

continue

#else:
##say the opposing team will win

`---------------------------------------------------------------------------
TweepError Traceback (most recent call last)
in
23 neutral_tweets = 0
24
---> 25 for tweet in warriors_tweets:
26 analysis = TextBlob(tweet.text)
27 if analysis.sentiment.polarity > 0:

4 frames
/usr/local/lib/python3.8/dist-packages/tweepy/cursor.py in next(self)
49
50 def next(self):
---> 51 return self.next()
52
53 def next(self):

/usr/local/lib/python3.8/dist-packages/tweepy/cursor.py in next(self)
241 if self.current_page is None or self.page_index == len(self.current_page) - 1:
242 # Reached end of current page, get the next page...
--> 243 self.current_page = self.page_iterator.next()
244 while len(self.current_page) == 0:
245 self.current_page = self.page_iterator.next()

/usr/local/lib/python3.8/dist-packages/tweepy/cursor.py in next(self)
130
131 if self.index >= len(self.results) - 1:
--> 132 data = self.method(max_id=self.max_id, parser=RawParser(), *self.args, **self.kwargs)
133
134 if hasattr(self.method, 'self'):

/usr/local/lib/python3.8/dist-packages/tweepy/binder.py in _call(*args, **kwargs)
251 return method
252 else:
--> 253 return method.execute()
254 finally:
255 method.session.close()

/usr/local/lib/python3.8/dist-packages/tweepy/binder.py in execute(self)
232 raise RateLimitError(error_msg, resp)
233 else:
--> 234 raise TweepError(error_msg, resp, api_code=api_error_code)
235
236 # Parse the response payload

TweepError: Twitter error response: status code = 401`

How to deploy to Firebase Web App?

In the setup instructions it tells you how to set up the Firebase config for android and ios but doesn't have instructions for setting up a web version

Please help.

2023-02-22 01:38:33.013251: E tensorflow/stream_executor/cuda/cuda_driver.cc:271] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2023-02-22 01:38:33.013315: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (5a210547b290): /proc/driver/nvidia/version does not exist
2023-02-22 01:38:33.013714: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "main.py", line 5, in
from src.Predict import NN_Runner, XGBoost_Runner
File "/content/src/Predict/NN_Runner.py", line 10, in
model = load_model('Models/NN_Models/Trained-Model-ML')
File "/usr/local/lib/python3.8/dist-packages/keras/saving/save.py", line 205, in load_model
return saved_model_load.load(filepath, compile, options)
File "/usr/local/lib/python3.8/dist-packages/keras/saving/saved_model/load.py", line 155, in load
model.compile(**saving_utils.compile_args_from_training_config(
File "/usr/local/lib/python3.8/dist-packages/keras/saving/saving_utils.py", line 202, in compile_args_from_training_config
optimizer = optimizers.deserialize(optimizer_config)
File "/usr/local/lib/python3.8/dist-packages/keras/optimizers.py", line 95, in deserialize
return deserialize_keras_object(
File "/usr/local/lib/python3.8/dist-packages/keras/utils/generic_utils.py", line 659, in deserialize_keras_object
(cls, cls_config) = class_and_config_for_serialized_keras_object(
File "/usr/local/lib/python3.8/dist-packages/keras/utils/generic_utils.py", line 556, in class_and_config_for_serialized_keras_object
raise ValueError(
ValueError: Unknown optimizer: Custom>Adam. Please ensure this object is passed to the custom_objects argument. See https://www.tensorflow.org/guide/keras/save_and_serialize#registering_the_custom_object for details.
WARNING:tensorflow:Unresolved object in checkpoint: (root).call
WARNING:tensorflow:Unresolved object in checkpoint: (root).call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root)._default_save_signature
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer-0.call
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer-0.call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-0.call
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-0.call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-1.call
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-1.call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-2.call
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-2.call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-3.call
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-3.call_and_return_all_conditional_losses
WARNING:tensorflow:Unresolved object in checkpoint: (root).call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).call.trace_1
WARNING:tensorflow:Unresolved object in checkpoint: (root).call.trace_2
WARNING:tensorflow:Unresolved object in checkpoint: (root).call.trace_3
WARNING:tensorflow:Unresolved object in checkpoint: (root).call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).call_and_return_all_conditional_losses.trace_1
WARNING:tensorflow:Unresolved object in checkpoint: (root).call_and_return_all_conditional_losses.trace_2
WARNING:tensorflow:Unresolved object in checkpoint: (root).call_and_return_all_conditional_losses.trace_3
WARNING:tensorflow:Unresolved object in checkpoint: (root).optimizer._update_step_xla
WARNING:tensorflow:Unresolved object in checkpoint: (root).signatures.serving_default
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer-0.call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer-0.call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-0.call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-0.call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-1.call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-1.call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-2.call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-2.call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-3.call.trace_0
WARNING:tensorflow:Unresolved object in checkpoint: (root).layer_with_weights-3.call_and_return_all_conditional_losses.trace_0
WARNING:tensorflow:A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights) but not all checkpointed values were used. See above for specific issues. Use expect_partial() on the load status object, e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings, or use assert_consumed() to make the check explicit. See https://www.tensorflow.org/guide/checkpoint#loading_mechanics for details.

Link

Hey, will you fix the link for the sports bettor?

/barematthias

Great tool

I am able to get everything working the collab with my api keys

But how do i have this built on firebase

Games are pulled, but no data

I'm using Colab, and I'm able to load games occurring on the day of, but I get this series of text when I run !python3 main.py -A -odds=fanduel

Traceback (most recent call last):
File "/content/main.py", line 106, in
main()
File "/content/main.py", line 79, in main
data, todays_games_uo, frame_ml, home_team_odds, away_team_odds = createTodaysGames(games, df, odds)
File "/content/main.py", line 52, in createTodaysGames
frame_ml = games_data_frame.drop(columns=['TEAM_ID', 'CFID', 'CFPARAMS', 'TEAM_NAME'])
File "/usr/local/lib/python3.8/dist-packages/pandas/util/_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/pandas/core/frame.py", line 4906, in drop
return super().drop(
File "/usr/local/lib/python3.8/dist-packages/pandas/core/generic.py", line 4150, in drop
obj = obj._drop_axis(labels, axis, level=level, errors=errors)
File "/usr/local/lib/python3.8/dist-packages/pandas/core/generic.py", line 4214, in _drop_axis
raise KeyError(f"{labels} not found in axis")
KeyError: "['TEAM_ID' 'CFID' 'CFPARAMS' 'TEAM_NAME'] not found in axis"

Anyidea of this issue?

ValueError: max() arg is an empty sequence

image

Creating Dataframe and Writing to Excel File

Got this error

ValueError Traceback (most recent call last)
in
----> 1 MAX_OUTCOMES = max([event.num_outcomes for event in arbitrage_events])
2 ARBITRAGE_EVENTS_COUNT = len(arbitrage_events)
3
4 my_columns = ['ID', 'Sport Key', 'Expected Earnings'] + list(np.array([[f'Bookmaker #{outcome}', f'Name #{outcome}', f'Odds #{outcome}', f'Amount to Buy #{outcome}'] for outcome in range(1, MAX_OUTCOMES + 1)]).flatten())
5 dataframe = pd.DataFrame(columns=my_columns)

ValueError: max() arg is an empty sequence

Typerror?

Hi, I can't seem to figure out what the problem is here:


TypeError Traceback (most recent call last)
in <cell line: 2>()
1 events = []
2 for data in odds_response:
----> 3 events.append(Event(data))
4 print(data)
5 print()

in init(self, data)
7 def init(self, data):
8 self.data = data
----> 9 self.sport_key = data['sport_key']
10 self.id = data['id']
11

 Not sure why this is causing issues. Anyone able to help?

probleme with Arbitrage.ipynb

Hello I have a problem at this step :

Creating Dataframe and Writing to Excel File

Error : ValueError Traceback (most recent call last)
in
----> 1 MAX_OUTCOMES = max([event.num_outcomes for event in arbitrage_events])
2 ARBITRAGE_EVENTS_COUNT = len(arbitrage_events)
3
4 my_columns = ['ID', 'Sport Key', 'Expected Earnings'] + list(np.array([[f'Bookmaker #{outcome}', f'Name #{outcome}', f'Odds #{outcome}', f'Amount to Buy #{outcome}'] for outcome in range(1, MAX_OUTCOMES + 1)]).flatten())
5 dataframe = pd.DataFrame(columns=my_columns)

ValueError: max() arg is an empty sequence

What I should do ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.