Facebook
From Silly Dormouse, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 680
  1. import json
  2. from pprint import pprint
  3. import re
  4.  
  5. import requests
  6.  
  7. _ = "dupa"
  8.  
  9. pattern = re.compile("(.)?([A-Z]*[a-z]+)( [A-Z]*[a-z]+){0,2}")
  10. patterns = ["Bitcoin", "Meta", "Dog", "Doge", "Ape", "Elon", "Cat", "NFT", "Shiba", "Inu", "Baby", "Moon", "Safe",
  11.             "Social", "Game", "Dollar", "USD", "Stable", "Fan", "Wallet", "League", "Land", "World", "Swap",
  12.             "Pay", "Club", "Fun", "Sport", "Space", "Cube", "Tether"]
  13.  
  14. # current = open("all").read().strip().split()
  15.  
  16. x = json.load(open("allgekoncoins.txt"))
  17.  
  18. print(len(x))
  19. # x = [i for i in x if i["id"] in current]
  20. x = [i for i in x if pattern.match(i["name"]) and len(pattern.match(i["name"])[0]) == len(i["name"])]
  21. x = [i for i in x if sum([1 for p in patterns if sum([1 for j in i["name"].split(" ") if j.lower().startswith(p.lower()) or j.lower().endswith(p.lower())]) != 0]) == 0]
  22.  
  23. ids = ",".join([i["id"] for i in x])
  24. r = ""
  25. while 1:
  26.     ids = ids.split(",")
  27.  
  28.     print(len(ids))
  29.  
  30.     if len(ids) <= 678:
  31.         ids2 = None
  32.         ids = ",".join(ids)
  33.     else:
  34.         ids2 = ",".join(ids[678:])
  35.         ids = ",".join(ids[:678])
  36.  
  37.     data = requests.get(f"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids={ids}").text
  38.  
  39.     data = json.loads(data)
  40.  
  41.     data = [i for i in data if i["circulating_supply"] and i["ath"] and i["ath_change_percentage"]
  42.             and i["circulating_supply"]*i["ath"] < 200000 and i["ath_change_percentage"] > -90
  43.             and i["market_cap"] and 4000 < i["market_cap"] < 50000 and i["market_cap_rank"] and i["id"] and i["name"] and i["current_price"] and \
  44.         i["price_change_percentage_24h"] and i["high_24h"] and i["low_24h"] and \
  45.         i["market_cap"] and i["total_volume"] and 1000000 < i["circulating_supply"] < 1000000000000]
  46.  
  47.     r += ","
  48.     r += ",".join([i["id"] for i in data])
  49.  
  50.     if ids2 is None:
  51.         break
  52.  
  53.     ids = ids2
  54.  
  55. r = r[1:]
  56.  
  57. print(r)
  58. print(len(r.split(",")))

Replies to Untitled rss

Title Name Language When
Re: Untitled Small Mousedeer text 1 Year ago.
Re: Untitled Lousy Camel text 1 Year ago.