Advertisement
TestGuy1

Source code

Sep 4th, 2021
453
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.56 KB | None | 1 0
  1. from html.parser import HTMLParser
  2. from secrets import token_hex
  3. from requests import post
  4. from os import system
  5.  
  6. # This is the source code behind this account
  7.  
  8. class pasteCount(HTMLParser):
  9.     count = 0
  10.     def handle_starttag(self, startTag, attrs):
  11.         self.count += 1 if startTag == "paste" else 0
  12.  
  13. textdata = """{{
  14.  status: '{}',
  15.  method: 'server',
  16.  maindata: '{}',
  17.  otherdata: [
  18.    '{}',
  19.    '{}',
  20.    '{}',
  21.    '{}',
  22.    '{}',
  23.    '{}',
  24.    '{}',
  25.    '{}'
  26.  ]
  27. }}"""
  28.  
  29. dev_key = ''
  30. user_key = ''
  31.  
  32. def getPasteCount():
  33.     counter = pasteCount()
  34.     r = post("https://pastebin.com/api/api_post.php", {"api_dev_key": dev_key, "api_user_key": user_key, "api_option": "list", "api_results_limit": 100})
  35.     if not r.text.startswith("Bad API request"):
  36.         counter.feed(r.text)
  37.         return counter.count - 2
  38.     return None
  39.  
  40. def sendPasteData():
  41.     r = post("https://pastebin.com/api/api_post.php", {"api_dev_key": dev_key, "api_paste_code": textdata.format("Success", token_hex(128), token_hex(16), token_hex(16), token_hex(16), token_hex(16), token_hex(16), token_hex(16), token_hex(16), token_hex(16)), "api_paste_name": f"data{getPasteCount()}", "api_paste_format": "json", "api_user_key": user_key, "api_folder_key": "JdRfrZ9j", "api_option": "paste"})
  42.     if r.text.startswith("Bad API request"):
  43.         system(f'notify-send -i dialog-error "Pastebin failed" "{r.text}"')
  44.     else:
  45.         system(f'notify-send -i dialog-information "Pastebin worked" "all is fine, {r.text}"')
  46.  
  47. if __name__ == "__main__":
  48.     sendPasteData()
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement