The script I'm using is pinging me for stock appearing in other stores so perhaps I'll get lucky today or this week!
Hey how did you get the script to work? I've been refreshing the apple stock checker every second of the day for the past week and no luck =[ I'm trying to track down a 6+ 128gb in Silver or gold, in bromley, southgate, covent garden, regent street, bluewater, white city, stratford city,
i dont understand html or any of this gibberish =[ x
If you're referring to the one here; when you download it, open it up in a text editor and follow the instructions given at the top. There's examples already included so it's easy to just modify it.
I have tried to do so, i downloaded ( bought!) the program that is recommended to run the script, however when i paste the script into the program modified, half of the script shows up red I'm assuming theres something dodgy with one of my modifications, i press run but it don't run, am i missing something?
This is on iPhone by the way
What do you want, and from which stores. I'll mod it if you're struggling.
you'd be a life saver!!! thank you so much
a iphone 6+ 128 GB in Silver ( or gold )
Stores:
Bluewater
Brent Cross
Bromley
Covent Garden
Lakeside
Regents street
southgate
stratford city
Victoria Square
Westquay
White City
import json, urllib, urllib2, base64, time
## [readme]
# (1). Install python 2.7 (this script will not work with python 3+)
# (2). Install PushBullet to your mobile device's + set it up (takes few minutes)
# - On PC, login to pushbullet.com and go to Account Settings, copy your API key and paste it into pushbullet_Key below
# (3). Look at stores variable below to find the exact names of the stores you want to be checked, enter their names exactly as shown into allowedStores below (use a comma for multiple stores)
# - DO NOT CHANGE stores/appleStores/appleStock URL's unless you know what you are doing / modfying this script for alternative locations (Canada?)
# (4). Look at the models variable in the Vars section below, locate all of the model codes that you want to be notified of when they are in stock at the stores chosen
# - Enter them into the wantedModels variable..
# (5). Change nextCheck to how long to wait until performing the next check (this is in seconds, 60seconds is recommended!)
# (6). Run script and leave running, as soon as there is stock for the chosen stores/models a PUSH notifation will be sent to all of your devices that are linked with the specified pushbullet account!
#
#
# (*) - See below as an example of a configuration that checks the Basingstake/Southampton/Reading stores for ANY iPhone 6+ stock every 60seconds
## [/readme]
## Config
pushbullet_Key = "ENTER_YOUR_API_KEY_HERE"
allowedStores = "Bluewater,Brent Cross,Bromley,Covent Garden,Lakeside,Regent Street,SouthGate,Stratford City,WestQuay,White City"
wantedModels = {
# 6+ 16GB
"MGA92" : False,
"MGA82" : False,
"MGAA2" : False,
# 6+ 64GB
"MGAJ2" : False,
"MGAH2" : False,
"MGAK2" : False,
# 6+ 128GB
"MGAE2" : True,
"MGAC2" : False,
"MGAF2" : True
};
nextCheck = 60
## Vars
appleStores = "https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/stores.json"
appleStock = "https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/availability.json"
stores = {
"R227" : "Bentall Centre",
"R113" : "Bluewater",
"R340" : "Braehead",
"R163" : "Brent Cross",
"R496" : "Bromley",
"R135" : "Buchanan Street",
"R118" : "Bullring",
"R252" : "Cabot Circus",
"R391" : "Chapelfield",
"R244" : "Churchill Square",
"R245" : "Covent Garden",
"R393" : "Cribbs Causeway",
"R545" : "Drake Circus",
"R341" : "Eldon Square",
"R482" : "Festival Place",
"R270" : "Grand Arcade",
"R308" : "Highcross",
"R242" : "Lakeside",
"R239" : "Liverpool ONE",
"R215" : "Manchester Arndale",
"R153" : "Meadowhall",
"R423" : "Metrocentre",
"R269" : "Milton Keynes",
"R279" : "Princesshay",
"R092" : "Regent Street",
"R335" : "SouthGate",
"R334" : "St David's 2",
"R410" : "Stratford City",
"R176" : "The Oracle",
"R255" : "Touchwood Centre",
"R136" : "Trafford Centre",
"R372" : "Trinity Leeds",
"R363" : "Union Square",
"R313" : "Victoria Square",
"R527" : "Watford",
"R174" : "WestQuay",
"R226" : "White City",
"R328" : "Princes Street"
};
models = { # iPhone 6
"MG482" : "iPhone 6 Silver 16GB",
"MG472" : "iPhone 6 Space Gray 16GB",
"MG492" : "iPhone 6 Gold 16GB",
"MG4H2" : "iPhone 6 Silver 64GB",
"MG4F2" : "iPhone 6 Space Gray 64GB",
"MG4J2" : "iPhone 6 Gold 64GB",
"MG4C2" : "iPhone 6 Silver 128GB",
"MG4A2" : "iPhone 6 Space Gray 128GB",
"MG4E2" : "iPhone 6 Gold 128GB",
# iPhone 6+
"MGA92" : "iPhone 6+ Silver 16GB",
"MGA82" : "iPhone 6+ Space Gray 16GB",
"MGAA2" : "iPhone 6+ Gold 16GB",
"MGAJ2" : "iPhone 6+ Silver 64GB",
"MGAH2" : "iPhone 6+ Space Gray 64GB",
"MGAK2" : "iPhone 6+ Gold 64GB",
"MGAE2" : "iPhone 6+ Silver 128GB",
"MGAC2" : "iPhone 6+ Space Gray 128GB",
"MGAF2" : "iPhone 6+ Gold 128GB"
};
## Quick Classes
class AppleStore:
def GetStores(self):
storesData = urllib2.urlopen(appleStores).read()
tmp = json.loads(storesData)
tmp2 = {}
for store in tmp['stores']:
if store['storeEnabled']:
tmp2[store['storeNumber']] = store['storeName']
return tmp2
def GetStock(self):
return urllib2.urlopen(appleStock).read()
class PushBullet:
def __init__(self, apiKey):
self.key = apiKey
self.auth = 'Basic {0}'.format(base64.b64encode(apiKey))
def sendNote(self, title, message):
header = { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json', 'Authorization': self.auth }
postData = urllib.urlencode({'type': 'note', 'title': title, 'body': message})
req = urllib2.Request("https://api.pushbullet.com/v2/pushes", postData, header)
return urllib2.urlopen(req).read()
## Funcs
def DoCheck():
apple = AppleStore()
push = PushBullet(pushbullet_Key)
stock = apple.GetStock()
tmp = json.loads(stock)
for store in tmp:
if store == "updated": continue
if allowedStores.find(stores[store]) != -1:
# Store is in allowedStores
for item in tmp[store]:
try: # Exceptions will occour if model is not in the wanted list
if wantedModels[item[:5]] and tmp[store][item]:
# Found stock!
push.sendNote(models[item[:5]], "Stock found at " + stores[store] + "\n\n" + time.strftime('(%d.%b.%y/%I:%M%p)'))
print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Found " + models[item[:5]] + " at " + stores[store]
except:
pass # continue the loop as current model is not wanted
print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Finished checking..."
## Main Code
if __name__ == '__main__':
#tmp = AppleStore()
#stores = tmp.GetStores()
while True:
try:
DoCheck()
except:
print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Hmm, reserve for pickup may be down?"
time.sleep(nextCheck)
OK so...
Code:import json, urllib, urllib2, base64, time ## [readme] # (1). Install python 2.7 (this script will not work with python 3+) # (2). Install PushBullet to your mobile device's + set it up (takes few minutes) # - On PC, login to pushbullet.com and go to Account Settings, copy your API key and paste it into pushbullet_Key below # (3). Look at stores variable below to find the exact names of the stores you want to be checked, enter their names exactly as shown into allowedStores below (use a comma for multiple stores) # - DO NOT CHANGE stores/appleStores/appleStock URL's unless you know what you are doing / modfying this script for alternative locations (Canada?) # (4). Look at the models variable in the Vars section below, locate all of the model codes that you want to be notified of when they are in stock at the stores chosen # - Enter them into the wantedModels variable.. # (5). Change nextCheck to how long to wait until performing the next check (this is in seconds, 60seconds is recommended!) # (6). Run script and leave running, as soon as there is stock for the chosen stores/models a PUSH notifation will be sent to all of your devices that are linked with the specified pushbullet account! # # # (*) - See below as an example of a configuration that checks the Basingstake/Southampton/Reading stores for ANY iPhone 6+ stock every 60seconds ## [/readme] ## Config pushbullet_Key = "ENTER_YOUR_API_KEY_HERE" allowedStores = "Bluewater,Brent Cross,Bromley,Covent Garden,Lakeside,Regent Street,SouthGate,Stratford City,WestQuay,White City" wantedModels = { # 6+ 16GB "MGA92" : False, "MGA82" : False, "MGAA2" : False, # 6+ 64GB "MGAJ2" : False, "MGAH2" : False, "MGAK2" : False, # 6+ 128GB "MGAE2" : True, "MGAC2" : False, "MGAF2" : True }; nextCheck = 60 ## Vars appleStores = "https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/stores.json" appleStock = "https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/availability.json" stores = { "R227" : "Bentall Centre", "R113" : "Bluewater", "R340" : "Braehead", "R163" : "Brent Cross", "R496" : "Bromley", "R135" : "Buchanan Street", "R118" : "Bullring", "R252" : "Cabot Circus", "R391" : "Chapelfield", "R244" : "Churchill Square", "R245" : "Covent Garden", "R393" : "Cribbs Causeway", "R545" : "Drake Circus", "R341" : "Eldon Square", "R482" : "Festival Place", "R270" : "Grand Arcade", "R308" : "Highcross", "R242" : "Lakeside", "R239" : "Liverpool ONE", "R215" : "Manchester Arndale", "R153" : "Meadowhall", "R423" : "Metrocentre", "R269" : "Milton Keynes", "R279" : "Princesshay", "R092" : "Regent Street", "R335" : "SouthGate", "R334" : "St David's 2", "R410" : "Stratford City", "R176" : "The Oracle", "R255" : "Touchwood Centre", "R136" : "Trafford Centre", "R372" : "Trinity Leeds", "R363" : "Union Square", "R313" : "Victoria Square", "R527" : "Watford", "R174" : "WestQuay", "R226" : "White City", "R328" : "Princes Street" }; models = { # iPhone 6 "MG482" : "iPhone 6 Silver 16GB", "MG472" : "iPhone 6 Space Gray 16GB", "MG492" : "iPhone 6 Gold 16GB", "MG4H2" : "iPhone 6 Silver 64GB", "MG4F2" : "iPhone 6 Space Gray 64GB", "MG4J2" : "iPhone 6 Gold 64GB", "MG4C2" : "iPhone 6 Silver 128GB", "MG4A2" : "iPhone 6 Space Gray 128GB", "MG4E2" : "iPhone 6 Gold 128GB", # iPhone 6+ "MGA92" : "iPhone 6+ Silver 16GB", "MGA82" : "iPhone 6+ Space Gray 16GB", "MGAA2" : "iPhone 6+ Gold 16GB", "MGAJ2" : "iPhone 6+ Silver 64GB", "MGAH2" : "iPhone 6+ Space Gray 64GB", "MGAK2" : "iPhone 6+ Gold 64GB", "MGAE2" : "iPhone 6+ Silver 128GB", "MGAC2" : "iPhone 6+ Space Gray 128GB", "MGAF2" : "iPhone 6+ Gold 128GB" }; ## Quick Classes class AppleStore: def GetStores(self): storesData = urllib2.urlopen(appleStores).read() tmp = json.loads(storesData) tmp2 = {} for store in tmp['stores']: if store['storeEnabled']: tmp2[store['storeNumber']] = store['storeName'] return tmp2 def GetStock(self): return urllib2.urlopen(appleStock).read() class PushBullet: def __init__(self, apiKey): self.key = apiKey self.auth = 'Basic {0}'.format(base64.b64encode(apiKey)) def sendNote(self, title, message): header = { 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json', 'Authorization': self.auth } postData = urllib.urlencode({'type': 'note', 'title': title, 'body': message}) req = urllib2.Request("https://api.pushbullet.com/v2/pushes", postData, header) return urllib2.urlopen(req).read() ## Funcs def DoCheck(): apple = AppleStore() push = PushBullet(pushbullet_Key) stock = apple.GetStock() tmp = json.loads(stock) for store in tmp: if store == "updated": continue if allowedStores.find(stores[store]) != -1: # Store is in allowedStores for item in tmp[store]: try: # Exceptions will occour if model is not in the wanted list if wantedModels[item[:5]] and tmp[store][item]: # Found stock! push.sendNote(models[item[:5]], "Stock found at " + stores[store] + "\n\n" + time.strftime('(%d.%b.%y/%I:%M%p)')) print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Found " + models[item[:5]] + " at " + stores[store] except: pass # continue the loop as current model is not wanted print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Finished checking..." ## Main Code if __name__ == '__main__': #tmp = AppleStore() #stores = tmp.GetStores() while True: try: DoCheck() except: print time.strftime('(%d.%b.%y/%I:%M%p)') + ": Hmm, reserve for pickup may be down?" time.sleep(nextCheck)
1) Copy the contents of the code block above into your python programme (I used something called IDLE? but remember it has to be Python 2.7 not 3.)
2) Enter your pushbullet key within the quotes. Just the number, within the existing quotes, replacing "ENTER_YOUR_API_KEY_HERE
3) Save it
4) Run --> Run Module
You should see Python Shell window and every minute you'll get 'Finished Checking' - which means its working, but not found anything.
This needs to be left running for it to work![]()
thankyou so much!! the push bullet key? is that under the cases token on pushbullet.com? the long numbers and letters?
Yes enter the long token key
FRANCESCASHIRKA - Mine is setup thank you but it checks every 4 minutes even though 60 is entered? What went wrong?
Thanks
I bought the Apple Leather Case before the phone arrived. It's nice, but I needed something solid to cover the screen. I tried a Bodyguardz clear skin. That too was cool, but it took something away from the ultra-smooth feel of the naked glass..../...now the owner of a 64GB grey 6+!
Wondering which case to buy...
thankyou so much!! the push bullet key? is that under the cases token on pushbullet.com? the long numbers and letters?
Hey guys! thank you ever so much for your help!!
I reserved my 128 + in bromley through refreshing the webpage, as no notification was sent to my phone i was lucky to grab it!!
what are the chances of reserving a device and going into the store and they have not actually got it? theres no more 128 left to reserve unless i got the one and only?
even if the script didn't work for me i will be sleeping with a smile on my face tonight!!! I'm still going to be lurking on this forum though, love reading it!
Hey guys! thank you ever so much for your help!!
I reserved my 128 + in bromley through refreshing the webpage, as no notification was sent to my phone i was lucky to grab it!!
what are the chances of reserving a device and going into the store and they have not actually got it? theres no more 128 left to reserve unless i got the one and only?
even if the script didn't work for me i will be sleeping with a smile on my face tonight!!! I'm still going to be lurking on this forum though, love reading it!
Hey hope you got it,i was at bromley on launch day it was crazy 6 + sold out at 6:30 before the store even opened so got a 6 which i returned when i managed to reserve a 6 plus and collect the following monday .Always try and get a slot early incase they over reserved
![]()