├── chromedriver.exe ├── nike-au-cart.png ├── README.md ├── LICENSE └── main.py /chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zyx898/Nike-au-bot/HEAD/chromedriver.exe -------------------------------------------------------------------------------- /nike-au-cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zyx898/Nike-au-bot/HEAD/nike-au-cart.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nike-au-bot 2 | "BOTBOTBOT??" 3 | If you enjoy my work please leave a star and follow me on **[Twitter](https://twitter.com/zyx898)** 4 | 5 | Looks like this 6 | 7 | 8 | 9 | Command: !nikecartAU sku size 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Yuanxu Zhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import time 3 | import random 4 | import discord 5 | from datetime import datetime 6 | from selenium import webdriver 7 | from selenium.webdriver.chrome.options import Options 8 | from bs4 import BeautifulSoup as soup 9 | import threading 10 | from discord_webhook import DiscordEmbed, DiscordWebhook 11 | 12 | def cart_nike_au(producturl,size): 13 | driver = webdriver.Chrome() 14 | driver.get(producturl) 15 | sizes = driver.find_elements_by_class_name('css-xf3ahq') 16 | for sizeinhtml in (sizes): 17 | if size in (sizeinhtml.text.split('/')[0]): 18 | break 19 | 20 | sizeinhtml.click() 21 | time.sleep(2) 22 | driver.find_element_by_xpath('//*[@id="buyTools"]/div[2]/button[1]').click() 23 | time.sleep(3) 24 | driver.get('https://www.nike.com/au/en/cart') 25 | while 'cart' not in driver.current_url: 26 | time.sleep(2) 27 | time.sleep(2) 28 | try: 29 | driver.find_element_by_xpath('//*[@id="react-root"]/div/div[6]/button').click() 30 | time.sleep(2) 31 | driver.find_element_by_xpath('//*[@id="react-root"]/div/div[4]/div/div/button[1]').click() 32 | except: 33 | driver.find_element_by_xpath('//*[@id="maincontent"]/div[2]/div[2]/aside/div[5]/div/button[1]').click() 34 | 35 | time.sleep(2) 36 | while "checkout" not in driver.current_url: 37 | time.sleep(2) 38 | return (driver.current_url) 39 | 40 | 41 | 42 | client = discord.Client() 43 | 44 | @client.event 45 | async def on_ready(): 46 | print("NIKE AU BOT") 47 | print('Logged in as %s' %client.user.name) 48 | print("Client User ID: %s" %client.user.name) 49 | print('------') 50 | game = discord.Game("NIKE AU CART") 51 | await client.change_presence(status=discord.Status.idle, activity=game) 52 | 53 | @client.event 54 | async def on_message(message): 55 | if message.content.startswith('!nikecartAU'): 56 | producturl = 'https://www.nike.com/au/t/xyisthebossman/'+message.content.split(" ")[1] 57 | cartsize = message.content.split(" ")[2] 58 | carturl = cart_nike_au(producturl,cartsize) 59 | embed = discord.Embed(title='Nike AU Cart',description='Wrote by XY in 20 minutes',color=0x36393F) 60 | embed.add_field(name='Cart Link', value=carturl,inline=True) 61 | embed.set_author(name='@zyx898') 62 | embed.set_footer(text='@zyx898 | SkrNotify',icon_url='https://pbs.twimg.com/profile_images/1134245182738718721/N12NVkrt_400x400.jpg') 63 | await message.channel.send(embed=embed) 64 | 65 | 66 | client.run('')## put your bot token 67 | --------------------------------------------------------------------------------