feat: Initial code drop
This commit is contained in:
parent
9aafbb4dfc
commit
804221b851
24
README.md
24
README.md
@ -1 +1,25 @@
|
||||
# bidbot
|
||||
|
||||
Install dependencies:
|
||||
```
|
||||
python3 -m pip install -r requirements.txt
|
||||
```
|
||||
|
||||
Copy `config.json.example` to `config.json` and fill in the values.
|
||||
Run:
|
||||
```
|
||||
python3 main.py config.json
|
||||
```
|
||||
|
||||
|
||||
Config format:
|
||||
```json
|
||||
{
|
||||
"namebaseToken": "s%A.....", // Namebase-main cookie
|
||||
"bid": 10, // Bid amount in HNS
|
||||
"blind": 10, // Blind amount (eg. bid of 10 + blind of 10 = lockup of 20)
|
||||
"prefix": "superlongdomain", // Prefix of domain to bid on (don't use anything already registered or you could create errors)
|
||||
"count": 100, // Number of domains to bid on
|
||||
"start": 0 // Starting index of domains to bid on (use this to resume from a previous run)
|
||||
}
|
||||
```
|
8
config.json.example
Normal file
8
config.json.example
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"namebaseToken": "s%A.....",
|
||||
"bid": "5.000000",
|
||||
"blind": "5.000000",
|
||||
"prefix": "testbotbids",
|
||||
"count": 100,
|
||||
"start": 0
|
||||
}
|
51
main.py
Normal file
51
main.py
Normal file
@ -0,0 +1,51 @@
|
||||
import requests
|
||||
import json
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
|
||||
# Get arguments from command line and store them in a list
|
||||
args = sys.argv[1:]
|
||||
configFile = 'config.json'
|
||||
|
||||
|
||||
if len(args) == 0:
|
||||
print("Using default config file: config.json")
|
||||
else:
|
||||
configFile = args[0]
|
||||
|
||||
if not os.path.isfile(configFile):
|
||||
print("Config file not found")
|
||||
exit()
|
||||
|
||||
# Open config file and load it into a dictionary
|
||||
with open(configFile) as json_file:
|
||||
config = json.load(json_file)
|
||||
|
||||
cookies = {
|
||||
'namebase-main': config['namebaseToken']
|
||||
}
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
data = {
|
||||
'bidAmount': config['bid'],
|
||||
'blindAmount': config['blind']
|
||||
}
|
||||
|
||||
# Loop for count domains
|
||||
start = config['start']
|
||||
number = config['count']
|
||||
# Create list of domains using prefix and number
|
||||
padding = len(str(number))
|
||||
print(data)
|
||||
|
||||
for i in range(number):
|
||||
domain = config['prefix'] + str(i).zfill(padding)
|
||||
print("Bidding on: " + domain)
|
||||
|
||||
response = requests.post('https://www.namebase.io/api/v0/auction/' + domain + '/bid', cookies=cookies,headers=headers, json=data)
|
||||
print(response.text)
|
||||
if response.status_code != 200:
|
||||
print("Error bidding on: " + domain)
|
||||
print(response.text)
|
||||
exit()
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
requests
|
Loading…
Reference in New Issue
Block a user