Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.87 KB | None | 0 0
  1. import http.client
  2. import requests
  3. from bs4 import BeautifulSoup
  4. import time
  5. import json
  6.  
  7.  
  8.  
  9. def send(message, webhook):
  10.  
  11.     conn = http.client.HTTPSConnection("discordapp.com")
  12.  
  13.     payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"content\"\r\n\r\n" + message + "\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--"
  14.  
  15.     headers = {
  16.         'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
  17.         'cache-control': "no-cache",
  18.         }
  19.  
  20.     conn.request("POST", webhook, payload, headers)
  21.  
  22.     res = conn.getresponse()
  23.     data = res.read()
  24.  
  25.     #print(data.decode("utf-8"))
  26.  
  27. def get_attributes_json(itemid,proxies,mobileheaders):
  28.     page=requests.get('http://www.supremenewyork.com/shop/'+itemid+'.json',headers=mobileheaders,proxies=proxies)
  29.     objet=json.loads(page.text)
  30.  
  31.     attributes=dict()
  32.     for item in objet['styles']:
  33.         attributes[item['name']]=item['sizes']
  34.  
  35.     return attributes
  36.  
  37.  
  38. proxcopurl='https://discordapp.com/api/webhooks/389419558730989571/NpuVvOcRZi2FPBReJKBP3hxSPUjutIincaK86vEJqjz0TrKX_21r7yx9TcnJP92tC4BF'
  39. mobileheaders={"User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1"}
  40. headers = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"}
  41. proxies = [{
  42.   'http': 'http://sapes.store:24002',
  43.   'https': 'http://sapes.store:24002',
  44. }]
  45.  
  46.  
  47. pid='171110'
  48.  
  49. j=get_attributes_json(pid,proxies[0],mobileheaders)
  50.  
  51. m='@everyone Box-Logo might have restocked. URL: http://www.supremenewyork.com/shop/sweatshirts/vwcq6doa1'
  52.  
  53.  
  54. while(True):
  55.     try:
  56.         if get_attributes_json(pid,proxies[0],mobileheaders)!=j:
  57.  
  58.             send(m,proxcopurl)
  59.     except:
  60.         pass
  61.     time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement