├── .gitignore ├── captcha ├── captcha - Copy.png ├── captcha.png ├── piece1.png └── piece2.png ├── chromedriver.exe ├── comment_simple.bat ├── comment_simple.py ├── gettokenids.py ├── piece1_result.jpg ├── piece2_result.jpg ├── sessions_selenium.txt ├── signup.py ├── start.bat ├── updateProfile.bat ├── updateProfile.py ├── vote_coin2.py └── watchlist2.py /.gitignore: -------------------------------------------------------------------------------- 1 | sessions.txt 2 | sessions_full.txt 3 | tokens.txt -------------------------------------------------------------------------------- /captcha/captcha - Copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/captcha/captcha - Copy.png -------------------------------------------------------------------------------- /captcha/captcha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/captcha/captcha.png -------------------------------------------------------------------------------- /captcha/piece1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/captcha/piece1.png -------------------------------------------------------------------------------- /captcha/piece2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/captcha/piece2.png -------------------------------------------------------------------------------- /chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/chromedriver.exe -------------------------------------------------------------------------------- /comment_simple.bat: -------------------------------------------------------------------------------- 1 | py comment_simple.py 2 | pause -------------------------------------------------------------------------------- /comment_simple.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import requests 3 | from requests.structures import CaseInsensitiveDict 4 | import mysql.connector 5 | from datetime import datetime 6 | import random 7 | from random import randrange 8 | from random import randint 9 | import time 10 | import concurrent.futures 11 | import json 12 | 13 | # Create the parser 14 | parser = argparse.ArgumentParser() 15 | 16 | # Add an argument 17 | # parser.add_argument('--content', type=str, required=True) 17964 18 | #parser.add_argument('--tokenid', type=str, required=True) # also called gravity 19 | #parser.add_argument('--nickname', type=str, required=True) 20 | #parser.add_argument('--start', type=int, required=True) 21 | #parser.add_argument('--end', type=int, required=True) 22 | 23 | # Parse the argument 24 | args = parser.parse_args() 25 | 26 | 27 | #content = args.content 28 | #tokenid = args.tokenid 29 | #nickname = args.nickname 30 | #start = args.start 31 | #end = args.end 32 | #proxies = { 'https': 'http://oxyTragas:YYTtagxasdS@4g.iproyal.com:6061', 'http': 'http://oxyTragas:YYTtagxasdS@4g.iproyal.com:6061' } 33 | proxies = { 'https': 'http://lum-customer-hl_e808edd6-zone-data_center:dwze8fb8sbcj@zproxy.lum-superproxy.io:22225', 'http': 'http://lum-customer-hl_e808edd6-zone-data_center:dwze8fb8sbcj@zproxy.lum-superproxy.io:22225' } 34 | #proxies = { 'https': 'http://5.79.73.131:13010', 'http': 'http://5.79.73.131:13010' } 35 | 36 | def make_random_sentence(): 37 | nouns = ["the", "of", "to", "and", "a", "in", "is", "it", "you", "that", "he", "was", "for", "on", "are", "with", "as", "I", "his", "they", "be", "at", "one", "have", "this", "from", "or", "had", "by", "not", "word", "but", "what", "some", "we", "can", "out", "other", "were", "all", "there", "when", "up", "use", "your", "how", "said", "an", "each", "she", "which", "do", "their", "time", "if", "will", "way", "about", "many", "then", "them", "write", "would", "like", "so", "these", "her", "long", "make", "thing", "see", "him", "two", "has", "look", "more", "day", "could", "go", "come", "did", "number", "sound", "no", "most", "people", "my", "over", "know", "water", "than", "call", "first", "who", "may", "down", "side", "been", "now", "find", "any", "new", "work", "part", "take", "get", "place", "made", "live", "where", "after", "back", "little", "only", "round", "man", "year", "came", "show", "every", "good", "me", "give", "our", "under", "name", "very", "through", "just", "form", "sentence", "great", "think", "say", "help", "low", "line", "differ", "turn", "cause", "much", "mean", "before", "move", "right", "boy", "old", "too", "same", "tell", "does", "set", "three", "want", "air", "well", "also", "play", "small", "end", "put", "home", "read", "hand", "port", "large", "spell", "add", "even", "land", "here", "must", "big", "high", "such", "follow", "act", "why", "ask", "men", "change", "went", "light", "kind", "off", "need", "house", "picture", "try", "us", "again", "animal", "point", "mother", "world", "near", "build", "self", "earth", "father", "head", "stand", "own", "page", "should", "country", "found", "answer", "school", "grow", "study", "still", "learn", "plant", "cover", "food", "sun", "four", "between", "state", "keep", "eye", "never", "last", "let", "thought", "city", "tree", "cross", "farm", "hard", "start", "might", "story", "saw", "far", "sea", "draw", "left", "late", "run", "don't", "while", "press", "close", "night", "real", "life", "few", "north", "open", "seem", "together", "next", "white", "children", "begin", "got", "walk", "example", "ease", "paper", "group", "always", "music", "those", "both", "mark", "often", "letter", "until", "mile", "river", "car", "feet", "care", "second", "book", "carry", "took", "science", "eat", "room", "friend", "began", "idea", "fish", "mountain", "stop", "once", "base", "hear", "horse", "cut", "sure", "watch", "color", "face", "wood", "main", "enough", "plain", "girl", "usual", "young", "ready", "above", "ever", "red", "list", "though", "feel", "talk", "bird", "soon", "body", "dog", "family", "direct", "pose", "leave", "song", "measure", "door", "product", "black", "short", "numeral", "class", "wind", "question", "happen", "complete", "ship", "area", "half", "rock", "order", "fire", "south", "problem", "piece", "told", "knew", "pass", "since", "top", "whole", "king", "space", "heard", "best", "hour", "better", "true", "during", "hundred", "five", "remember", "step", "early", "hold", "west", "ground", "interest", "reach", "fast", "verb", "sing", "listen", "six", "table", "travel", "less", "morning", "ten", "simple", "several", "vowel", "toward", "war", "lay", "against", "pattern", "slow", "center", "love", "person", "money", "serve", "appear", "road", "map", "rain", "rule", "govern", "pull", "cold", "notice", "voice", "unit", "power", "town", "fine", "certain", "fly", "fall", "lead", "cry", "dark", "machine", "note", "wait", "plan", "figure", "star", "box", "noun", "field", "rest", "correct", "able", "pound", "done", "beauty", "drive", "stood", "contain", "front", "teach", "week", "final", "gave", "green", "oh", "quick", "develop", "ocean", "warm", "free", "minute", "strong", "special", "mind", "behind", "clear", "tail", "produce", "fact", "street", "inch", "multiply", "nothing", "course", "stay", "wheel", "full", "force", "blue", "object", "decide", "surface", "deep", "moon", "island", "foot", "system", "busy", "test", "record", "boat", "common", "gold", "possible", "plane", "stead", "dry", "wonder", "laugh", "thousand", "ago", "ran", "check", "game", "shape", "equate", "hot", "miss", "brought", "heat", "snow", "tire", "bring", "yes", "distant", "fill", "east", "paint", "language", "among", "grand", "ball", "yet", "wave", "drop", "heart", "am", "present", "heavy", "dance", "engine", "position", "arm", "wide", "sail", "material", "size", "vary", "settle", "speak", "weight", "general", "ice", "matter", "circle", "pair", "include", "divide", "syllable", "felt", "perhaps", "pick", "sudden", "count", "square", "reason", "length", "represent", "art", "subject", "region", "energy", "hunt", "probable", "bed", "brother", "egg", "ride", "cell", "believe", "fraction", "forest", "sit", "race", "window", "store", "summer", "train", "sleep", "prove", "lone", "leg", "exercise", "wall", "catch", "mount", "wish", "sky", "board", "joy", "winter", "sat", "written", "wild", "instrument", "kept", "glass", "grass", "cow", "job", "edge", "sign", "visit", "past", "soft", "fun", "bright", "gas", "weather", "month", "million", "bear", "finish", "happy", "hope", "flower", "clothe", "strange", "gone", "jump", "baby", "eight", "village", "meet", "root", "buy", "raise", "solve", "metal", "whether", "push", "seven", "paragraph", "third", "shall", "held", "hair", "describe", "cook", "floor", "either", "result", "burn", "hill", "safe", "cat", "century", "consider", "type", "law", "bit", "coast", "copy", "phrase", "silent", "tall", "sand", "soil", "roll", "temperature", "finger", "industry", "value", "fight", "lie", "beat", "excite", "natural", "view", "sense", "ear", "else", "quite", "broke", "case", "middle", "kill", "son", "lake", "moment", "scale", "loud", "spring", "observe", "child", "straight", "consonant", "nation", "dictionary", "milk", "speed", "method", "organ", "pay", "age", "section", "dress", "cloud", "surprise", "quiet", "stone", "tiny", "climb", "cool", "design", "poor", "lot", "experiment", "bottom", "key", "iron", "single", "stick", "flat", "twenty", "skin", "smile", "crease", "hole", "trade", "melody", "trip", "office", "receive", "row", "mouth", "exact", "symbol", "die", "least", "trouble", "shout", "except", "wrote", "seed", "tone", "join", "suggest", "clean", "break", "lady", "yard", "rise", "bad", "blow", "oil", "blood", "touch", "grew", "cent", "mix", "team", "wire", "cost", "lost", "brown", "wear", "garden", "equal", "sent", "choose", "fell", "fit", "flow", "fair", "bank", "collect", "save", "control", "decimal", "gentle", "woman", "captain", "practice", "separate", "difficult", "doctor", "please", "protect", "noon", "whose", "locate", "ring", "character", "insect", "caught", "period", "indicate", "radio", "spoke", "atom", "human", "history", "effect", "electric", "expect", "crop", "modern", "element", "hit", "student", "corner", "party", "supply", "bone", "rail", "imagine", "provide", "agree", "thus", "capital", "won't", "chair", "danger", "fruit", "rich", "thick", "soldier", "process", "operate", "guess", "necessary", "sharp", "wing", "create", "neighbor", "wash", "bat", "rather", "crowd", "corn", "compare", "poem", "string", "bell", "depend", "meat", "rub", "tube", "famous", "dollar", "stream", "fear", "sight", "thin", "triangle", "planet", "hurry", "chief", "colony", "clock", "mine", "tie", "enter", "major", "fresh", "search", "send", "yellow", "gun", "allow", "print", "dead", "spot", "desert", "suit", "current", "lift", "rose", "continue", "block", "chart", "hat", "sell", "success", "company", "subtract", "event", "particular", "deal", "swim", "term", "opposite", "wife", "shoe", "shoulder", "spread", "arrange", "camp", "invent", "cotton", "born", "determine", "quart", "nine", "truck", "noise", "level", "chance", "gather", "shop", "stretch", "throw", "shine", "property", "column", "molecule", "select", "wrong", "gray", "repeat", "require", "broad", "prepare", "salt", "nose", "plural", "anger", "claim", "continent", "oxygen", "sugar", "death", "pretty", "skill", "women", "season", "solution", "magnet", "silver", "thank", "branch", "match", "suffix", "especially", "fig", "afraid", "huge", "sister", "steel", "discuss", "forward", "similar", "guide", "experience", "score", "apple", "bought", "led", "pitch", "coat", "mass", "card", "band", "rope", "slip", "win", "dream", "evening", "condition", "feed", "tool", "total", "basic", "smell", "valley", "nor", "double", "seat", "arrive", "master", "track", "parent", "shore", "division", "sheet", "substance", "favor", "connect", "post", "spend", "chord", "fat", "glad", "original", "share", "station", "dad", "bread", "charge", "proper", "bar", "offer", "segment", "slave", "duck", "instant", "market", "degree", "populate", "chick", "dear", "enemy", "reply", "drink", "occur", "support", "speech", "nature", "range", "steam", "motion", "path", "liquid", "log", "meant", "quotient", "teeth", "shell", "neck"] 38 | verbs = ["the", "of", "to", "and", "a", "in", "is", "it", "you", "that", "he", "was", "for", "on", "are", "with", "as", "I", "his", "they", "be", "at", "one", "have", "this", "from", "or", "had", "by", "not", "word", "but", "what", "some", "we", "can", "out", "other", "were", "all", "there", "when", "up", "use", "your", "how", "said", "an", "each", "she", "which", "do", "their", "time", "if", "will", "way", "about", "many", "then", "them", "write", "would", "like", "so", "these", "her", "long", "make", "thing", "see", "him", "two", "has", "look", "more", "day", "could", "go", "come", "did", "number", "sound", "no", "most", "people", "my", "over", "know", "water", "than", "call", "first", "who", "may", "down", "side", "been", "now", "find", "any", "new", "work", "part", "take", "get", "place", "made", "live", "where", "after", "back", "little", "only", "round", "man", "year", "came", "show", "every", "good", "me", "give", "our", "under", "name", "very", "through", "just", "form", "sentence", "great", "think", "say", "help", "low", "line", "differ", "turn", "cause", "much", "mean", "before", "move", "right", "boy", "old", "too", "same", "tell", "does", "set", "three", "want", "air", "well", "also", "play", "small", "end", "put", "home", "read", "hand", "port", "large", "spell", "add", "even", "land", "here", "must", "big", "high", "such", "follow", "act", "why", "ask", "men", "change", "went", "light", "kind", "off", "need", "house", "picture", "try", "us", "again", "animal", "point", "mother", "world", "near", "build", "self", "earth", "father", "head", "stand", "own", "page", "should", "country", "found", "answer", "school", "grow", "study", "still", "learn", "plant", "cover", "food", "sun", "four", "between", "state", "keep", "eye", "never", "last", "let", "thought", "city", "tree", "cross", "farm", "hard", "start", "might", "story", "saw", "far", "sea", "draw", "left", "late", "run", "don't", "while", "press", "close", "night", "real", "life", "few", "north", "open", "seem", "together", "next", "white", "children", "begin", "got", "walk", "example", "ease", "paper", "group", "always", "music", "those", "both", "mark", "often", "letter", "until", "mile", "river", "car", "feet", "care", "second", "book", "carry", "took", "science", "eat", "room", "friend", "began", "idea", "fish", "mountain", "stop", "once", "base", "hear", "horse", "cut", "sure", "watch", "color", "face", "wood", "main", "enough", "plain", "girl", "usual", "young", "ready", "above", "ever", "red", "list", "though", "feel", "talk", "bird", "soon", "body", "dog", "family", "direct", "pose", "leave", "song", "measure", "door", "product", "black", "short", "numeral", "class", "wind", "question", "happen", "complete", "ship", "area", "half", "rock", "order", "fire", "south", "problem", "piece", "told", "knew", "pass", "since", "top", "whole", "king", "space", "heard", "best", "hour", "better", "true", "during", "hundred", "five", "remember", "step", "early", "hold", "west", "ground", "interest", "reach", "fast", "verb", "sing", "listen", "six", "table", "travel", "less", "morning", "ten", "simple", "several", "vowel", "toward", "war", "lay", "against", "pattern", "slow", "center", "love", "person", "money", "serve", "appear", "road", "map", "rain", "rule", "govern", "pull", "cold", "notice", "voice", "unit", "power", "town", "fine", "certain", "fly", "fall", "lead", "cry", "dark", "machine", "note", "wait", "plan", "figure", "star", "box", "noun", "field", "rest", "correct", "able", "pound", "done", "beauty", "drive", "stood", "contain", "front", "teach", "week", "final", "gave", "green", "oh", "quick", "develop", "ocean", "warm", "free", "minute", "strong", "special", "mind", "behind", "clear", "tail", "produce", "fact", "street", "inch", "multiply", "nothing", "course", "stay", "wheel", "full", "force", "blue", "object", "decide", "surface", "deep", "moon", "island", "foot", "system", "busy", "test", "record", "boat", "common", "gold", "possible", "plane", "stead", "dry", "wonder", "laugh", "thousand", "ago", "ran", "check", "game", "shape", "equate", "hot", "miss", "brought", "heat", "snow", "tire", "bring", "yes", "distant", "fill", "east", "paint", "language", "among", "grand", "ball", "yet", "wave", "drop", "heart", "am", "present", "heavy", "dance", "engine", "position", "arm", "wide", "sail", "material", "size", "vary", "settle", "speak", "weight", "general", "ice", "matter", "circle", "pair", "include", "divide", "syllable", "felt", "perhaps", "pick", "sudden", "count", "square", "reason", "length", "represent", "art", "subject", "region", "energy", "hunt", "probable", "bed", "brother", "egg", "ride", "cell", "believe", "fraction", "forest", "sit", "race", "window", "store", "summer", "train", "sleep", "prove", "lone", "leg", "exercise", "wall", "catch", "mount", "wish", "sky", "board", "joy", "winter", "sat", "written", "wild", "instrument", "kept", "glass", "grass", "cow", "job", "edge", "sign", "visit", "past", "soft", "fun", "bright", "gas", "weather", "month", "million", "bear", "finish", "happy", "hope", "flower", "clothe", "strange", "gone", "jump", "baby", "eight", "village", "meet", "root", "buy", "raise", "solve", "metal", "whether", "push", "seven", "paragraph", "third", "shall", "held", "hair", "describe", "cook", "floor", "either", "result", "burn", "hill", "safe", "cat", "century", "consider", "type", "law", "bit", "coast", "copy", "phrase", "silent", "tall", "sand", "soil", "roll", "temperature", "finger", "industry", "value", "fight", "lie", "beat", "excite", "natural", "view", "sense", "ear", "else", "quite", "broke", "case", "middle", "kill", "son", "lake", "moment", "scale", "loud", "spring", "observe", "child", "straight", "consonant", "nation", "dictionary", "milk", "speed", "method", "organ", "pay", "age", "section", "dress", "cloud", "surprise", "quiet", "stone", "tiny", "climb", "cool", "design", "poor", "lot", "experiment", "bottom", "key", "iron", "single", "stick", "flat", "twenty", "skin", "smile", "crease", "hole", "trade", "melody", "trip", "office", "receive", "row", "mouth", "exact", "symbol", "die", "least", "trouble", "shout", "except", "wrote", "seed", "tone", "join", "suggest", "clean", "break", "lady", "yard", "rise", "bad", "blow", "oil", "blood", "touch", "grew", "cent", "mix", "team", "wire", "cost", "lost", "brown", "wear", "garden", "equal", "sent", "choose", "fell", "fit", "flow", "fair", "bank", "collect", "save", "control", "decimal", "gentle", "woman", "captain", "practice", "separate", "difficult", "doctor", "please", "protect", "noon", "whose", "locate", "ring", "character", "insect", "caught", "period", "indicate", "radio", "spoke", "atom", "human", "history", "effect", "electric", "expect", "crop", "modern", "element", "hit", "student", "corner", "party", "supply", "bone", "rail", "imagine", "provide", "agree", "thus", "capital", "won't", "chair", "danger", "fruit", "rich", "thick", "soldier", "process", "operate", "guess", "necessary", "sharp", "wing", "create", "neighbor", "wash", "bat", "rather", "crowd", "corn", "compare", "poem", "string", "bell", "depend", "meat", "rub", "tube", "famous", "dollar", "stream", "fear", "sight", "thin", "triangle", "planet", "hurry", "chief", "colony", "clock", "mine", "tie", "enter", "major", "fresh", "search", "send", "yellow", "gun", "allow", "print", "dead", "spot", "desert", "suit", "current", "lift", "rose", "continue", "block", "chart", "hat", "sell", "success", "company", "subtract", "event", "particular", "deal", "swim", "term", "opposite", "wife", "shoe", "shoulder", "spread", "arrange", "camp", "invent", "cotton", "born", "determine", "quart", "nine", "truck", "noise", "level", "chance", "gather", "shop", "stretch", "throw", "shine", "property", "column", "molecule", "select", "wrong", "gray", "repeat", "require", "broad", "prepare", "salt", "nose", "plural", "anger", "claim", "continent", "oxygen", "sugar", "death", "pretty", "skill", "women", "season", "solution", "magnet", "silver", "thank", "branch", "match", "suffix", "especially", "fig", "afraid", "huge", "sister", "steel", "discuss", "forward", "similar", "guide", "experience", "score", "apple", "bought", "led", "pitch", "coat", "mass", "card", "band", "rope", "slip", "win", "dream", "evening", "condition", "feed", "tool", "total", "basic", "smell", "valley", "nor", "double", "seat", "arrive", "master", "track", "parent", "shore", "division", "sheet", "substance", "favor", "connect", "post", "spend", "chord", "fat", "glad", "original", "share", "station", "dad", "bread", "charge", "proper", "bar", "offer", "segment", "slave", "duck", "instant", "market", "degree", "populate", "chick", "dear", "enemy", "reply", "drink", "occur", "support", "speech", "nature", "range", "steam", "motion", "path", "liquid", "log", "meant", "quotient", "teeth", "shell", "neck"] 39 | adv = ["the", "of", "to", "and", "a", "in", "is", "it", "you", "that", "he", "was", "for", "on", "are", "with", "as", "I", "his", "they", "be", "at", "one", "have", "this", "from", "or", "had", "by", "not", "word", "but", "what", "some", "we", "can", "out", "other", "were", "all", "there", "when", "up", "use", "your", "how", "said", "an", "each", "she", "which", "do", "their", "time", "if", "will", "way", "about", "many", "then", "them", "write", "would", "like", "so", "these", "her", "long", "make", "thing", "see", "him", "two", "has", "look", "more", "day", "could", "go", "come", "did", "number", "sound", "no", "most", "people", "my", "over", "know", "water", "than", "call", "first", "who", "may", "down", "side", "been", "now", "find", "any", "new", "work", "part", "take", "get", "place", "made", "live", "where", "after", "back", "little", "only", "round", "man", "year", "came", "show", "every", "good", "me", "give", "our", "under", "name", "very", "through", "just", "form", "sentence", "great", "think", "say", "help", "low", "line", "differ", "turn", "cause", "much", "mean", "before", "move", "right", "boy", "old", "too", "same", "tell", "does", "set", "three", "want", "air", "well", "also", "play", "small", "end", "put", "home", "read", "hand", "port", "large", "spell", "add", "even", "land", "here", "must", "big", "high", "such", "follow", "act", "why", "ask", "men", "change", "went", "light", "kind", "off", "need", "house", "picture", "try", "us", "again", "animal", "point", "mother", "world", "near", "build", "self", "earth", "father", "head", "stand", "own", "page", "should", "country", "found", "answer", "school", "grow", "study", "still", "learn", "plant", "cover", "food", "sun", "four", "between", "state", "keep", "eye", "never", "last", "let", "thought", "city", "tree", "cross", "farm", "hard", "start", "might", "story", "saw", "far", "sea", "draw", "left", "late", "run", "don't", "while", "press", "close", "night", "real", "life", "few", "north", "open", "seem", "together", "next", "white", "children", "begin", "got", "walk", "example", "ease", "paper", "group", "always", "music", "those", "both", "mark", "often", "letter", "until", "mile", "river", "car", "feet", "care", "second", "book", "carry", "took", "science", "eat", "room", "friend", "began", "idea", "fish", "mountain", "stop", "once", "base", "hear", "horse", "cut", "sure", "watch", "color", "face", "wood", "main", "enough", "plain", "girl", "usual", "young", "ready", "above", "ever", "red", "list", "though", "feel", "talk", "bird", "soon", "body", "dog", "family", "direct", "pose", "leave", "song", "measure", "door", "product", "black", "short", "numeral", "class", "wind", "question", "happen", "complete", "ship", "area", "half", "rock", "order", "fire", "south", "problem", "piece", "told", "knew", "pass", "since", "top", "whole", "king", "space", "heard", "best", "hour", "better", "true", "during", "hundred", "five", "remember", "step", "early", "hold", "west", "ground", "interest", "reach", "fast", "verb", "sing", "listen", "six", "table", "travel", "less", "morning", "ten", "simple", "several", "vowel", "toward", "war", "lay", "against", "pattern", "slow", "center", "love", "person", "money", "serve", "appear", "road", "map", "rain", "rule", "govern", "pull", "cold", "notice", "voice", "unit", "power", "town", "fine", "certain", "fly", "fall", "lead", "cry", "dark", "machine", "note", "wait", "plan", "figure", "star", "box", "noun", "field", "rest", "correct", "able", "pound", "done", "beauty", "drive", "stood", "contain", "front", "teach", "week", "final", "gave", "green", "oh", "quick", "develop", "ocean", "warm", "free", "minute", "strong", "special", "mind", "behind", "clear", "tail", "produce", "fact", "street", "inch", "multiply", "nothing", "course", "stay", "wheel", "full", "force", "blue", "object", "decide", "surface", "deep", "moon", "island", "foot", "system", "busy", "test", "record", "boat", "common", "gold", "possible", "plane", "stead", "dry", "wonder", "laugh", "thousand", "ago", "ran", "check", "game", "shape", "equate", "hot", "miss", "brought", "heat", "snow", "tire", "bring", "yes", "distant", "fill", "east", "paint", "language", "among", "grand", "ball", "yet", "wave", "drop", "heart", "am", "present", "heavy", "dance", "engine", "position", "arm", "wide", "sail", "material", "size", "vary", "settle", "speak", "weight", "general", "ice", "matter", "circle", "pair", "include", "divide", "syllable", "felt", "perhaps", "pick", "sudden", "count", "square", "reason", "length", "represent", "art", "subject", "region", "energy", "hunt", "probable", "bed", "brother", "egg", "ride", "cell", "believe", "fraction", "forest", "sit", "race", "window", "store", "summer", "train", "sleep", "prove", "lone", "leg", "exercise", "wall", "catch", "mount", "wish", "sky", "board", "joy", "winter", "sat", "written", "wild", "instrument", "kept", "glass", "grass", "cow", "job", "edge", "sign", "visit", "past", "soft", "fun", "bright", "gas", "weather", "month", "million", "bear", "finish", "happy", "hope", "flower", "clothe", "strange", "gone", "jump", "baby", "eight", "village", "meet", "root", "buy", "raise", "solve", "metal", "whether", "push", "seven", "paragraph", "third", "shall", "held", "hair", "describe", "cook", "floor", "either", "result", "burn", "hill", "safe", "cat", "century", "consider", "type", "law", "bit", "coast", "copy", "phrase", "silent", "tall", "sand", "soil", "roll", "temperature", "finger", "industry", "value", "fight", "lie", "beat", "excite", "natural", "view", "sense", "ear", "else", "quite", "broke", "case", "middle", "kill", "son", "lake", "moment", "scale", "loud", "spring", "observe", "child", "straight", "consonant", "nation", "dictionary", "milk", "speed", "method", "organ", "pay", "age", "section", "dress", "cloud", "surprise", "quiet", "stone", "tiny", "climb", "cool", "design", "poor", "lot", "experiment", "bottom", "key", "iron", "single", "stick", "flat", "twenty", "skin", "smile", "crease", "hole", "trade", "melody", "trip", "office", "receive", "row", "mouth", "exact", "symbol", "die", "least", "trouble", "shout", "except", "wrote", "seed", "tone", "join", "suggest", "clean", "break", "lady", "yard", "rise", "bad", "blow", "oil", "blood", "touch", "grew", "cent", "mix", "team", "wire", "cost", "lost", "brown", "wear", "garden", "equal", "sent", "choose", "fell", "fit", "flow", "fair", "bank", "collect", "save", "control", "decimal", "gentle", "woman", "captain", "practice", "separate", "difficult", "doctor", "please", "protect", "noon", "whose", "locate", "ring", "character", "insect", "caught", "period", "indicate", "radio", "spoke", "atom", "human", "history", "effect", "electric", "expect", "crop", "modern", "element", "hit", "student", "corner", "party", "supply", "bone", "rail", "imagine", "provide", "agree", "thus", "capital", "won't", "chair", "danger", "fruit", "rich", "thick", "soldier", "process", "operate", "guess", "necessary", "sharp", "wing", "create", "neighbor", "wash", "bat", "rather", "crowd", "corn", "compare", "poem", "string", "bell", "depend", "meat", "rub", "tube", "famous", "dollar", "stream", "fear", "sight", "thin", "triangle", "planet", "hurry", "chief", "colony", "clock", "mine", "tie", "enter", "major", "fresh", "search", "send", "yellow", "gun", "allow", "print", "dead", "spot", "desert", "suit", "current", "lift", "rose", "continue", "block", "chart", "hat", "sell", "success", "company", "subtract", "event", "particular", "deal", "swim", "term", "opposite", "wife", "shoe", "shoulder", "spread", "arrange", "camp", "invent", "cotton", "born", "determine", "quart", "nine", "truck", "noise", "level", "chance", "gather", "shop", "stretch", "throw", "shine", "property", "column", "molecule", "select", "wrong", "gray", "repeat", "require", "broad", "prepare", "salt", "nose", "plural", "anger", "claim", "continent", "oxygen", "sugar", "death", "pretty", "skill", "women", "season", "solution", "magnet", "silver", "thank", "branch", "match", "suffix", "especially", "fig", "afraid", "huge", "sister", "steel", "discuss", "forward", "similar", "guide", "experience", "score", "apple", "bought", "led", "pitch", "coat", "mass", "card", "band", "rope", "slip", "win", "dream", "evening", "condition", "feed", "tool", "total", "basic", "smell", "valley", "nor", "double", "seat", "arrive", "master", "track", "parent", "shore", "division", "sheet", "substance", "favor", "connect", "post", "spend", "chord", "fat", "glad", "original", "share", "station", "dad", "bread", "charge", "proper", "bar", "offer", "segment", "slave", "duck", "instant", "market", "degree", "populate", "chick", "dear", "enemy", "reply", "drink", "occur", "support", "speech", "nature", "range", "steam", "motion", "path", "liquid", "log", "meant", "quotient", "teeth", "shell", "neck"] 40 | adj = ["the", "of", "to", "and", "a", "in", "is", "it", "you", "that", "he", "was", "for", "on", "are", "with", "as", "I", "his", "they", "be", "at", "one", "have", "this", "from", "or", "had", "by", "not", "word", "but", "what", "some", "we", "can", "out", "other", "were", "all", "there", "when", "up", "use", "your", "how", "said", "an", "each", "she", "which", "do", "their", "time", "if", "will", "way", "about", "many", "then", "them", "write", "would", "like", "so", "these", "her", "long", "make", "thing", "see", "him", "two", "has", "look", "more", "day", "could", "go", "come", "did", "number", "sound", "no", "most", "people", "my", "over", "know", "water", "than", "call", "first", "who", "may", "down", "side", "been", "now", "find", "any", "new", "work", "part", "take", "get", "place", "made", "live", "where", "after", "back", "little", "only", "round", "man", "year", "came", "show", "every", "good", "me", "give", "our", "under", "name", "very", "through", "just", "form", "sentence", "great", "think", "say", "help", "low", "line", "differ", "turn", "cause", "much", "mean", "before", "move", "right", "boy", "old", "too", "same", "tell", "does", "set", "three", "want", "air", "well", "also", "play", "small", "end", "put", "home", "read", "hand", "port", "large", "spell", "add", "even", "land", "here", "must", "big", "high", "such", "follow", "act", "why", "ask", "men", "change", "went", "light", "kind", "off", "need", "house", "picture", "try", "us", "again", "animal", "point", "mother", "world", "near", "build", "self", "earth", "father", "head", "stand", "own", "page", "should", "country", "found", "answer", "school", "grow", "study", "still", "learn", "plant", "cover", "food", "sun", "four", "between", "state", "keep", "eye", "never", "last", "let", "thought", "city", "tree", "cross", "farm", "hard", "start", "might", "story", "saw", "far", "sea", "draw", "left", "late", "run", "don't", "while", "press", "close", "night", "real", "life", "few", "north", "open", "seem", "together", "next", "white", "children", "begin", "got", "walk", "example", "ease", "paper", "group", "always", "music", "those", "both", "mark", "often", "letter", "until", "mile", "river", "car", "feet", "care", "second", "book", "carry", "took", "science", "eat", "room", "friend", "began", "idea", "fish", "mountain", "stop", "once", "base", "hear", "horse", "cut", "sure", "watch", "color", "face", "wood", "main", "enough", "plain", "girl", "usual", "young", "ready", "above", "ever", "red", "list", "though", "feel", "talk", "bird", "soon", "body", "dog", "family", "direct", "pose", "leave", "song", "measure", "door", "product", "black", "short", "numeral", "class", "wind", "question", "happen", "complete", "ship", "area", "half", "rock", "order", "fire", "south", "problem", "piece", "told", "knew", "pass", "since", "top", "whole", "king", "space", "heard", "best", "hour", "better", "true", "during", "hundred", "five", "remember", "step", "early", "hold", "west", "ground", "interest", "reach", "fast", "verb", "sing", "listen", "six", "table", "travel", "less", "morning", "ten", "simple", "several", "vowel", "toward", "war", "lay", "against", "pattern", "slow", "center", "love", "person", "money", "serve", "appear", "road", "map", "rain", "rule", "govern", "pull", "cold", "notice", "voice", "unit", "power", "town", "fine", "certain", "fly", "fall", "lead", "cry", "dark", "machine", "note", "wait", "plan", "figure", "star", "box", "noun", "field", "rest", "correct", "able", "pound", "done", "beauty", "drive", "stood", "contain", "front", "teach", "week", "final", "gave", "green", "oh", "quick", "develop", "ocean", "warm", "free", "minute", "strong", "special", "mind", "behind", "clear", "tail", "produce", "fact", "street", "inch", "multiply", "nothing", "course", "stay", "wheel", "full", "force", "blue", "object", "decide", "surface", "deep", "moon", "island", "foot", "system", "busy", "test", "record", "boat", "common", "gold", "possible", "plane", "stead", "dry", "wonder", "laugh", "thousand", "ago", "ran", "check", "game", "shape", "equate", "hot", "miss", "brought", "heat", "snow", "tire", "bring", "yes", "distant", "fill", "east", "paint", "language", "among", "grand", "ball", "yet", "wave", "drop", "heart", "am", "present", "heavy", "dance", "engine", "position", "arm", "wide", "sail", "material", "size", "vary", "settle", "speak", "weight", "general", "ice", "matter", "circle", "pair", "include", "divide", "syllable", "felt", "perhaps", "pick", "sudden", "count", "square", "reason", "length", "represent", "art", "subject", "region", "energy", "hunt", "probable", "bed", "brother", "egg", "ride", "cell", "believe", "fraction", "forest", "sit", "race", "window", "store", "summer", "train", "sleep", "prove", "lone", "leg", "exercise", "wall", "catch", "mount", "wish", "sky", "board", "joy", "winter", "sat", "written", "wild", "instrument", "kept", "glass", "grass", "cow", "job", "edge", "sign", "visit", "past", "soft", "fun", "bright", "gas", "weather", "month", "million", "bear", "finish", "happy", "hope", "flower", "clothe", "strange", "gone", "jump", "baby", "eight", "village", "meet", "root", "buy", "raise", "solve", "metal", "whether", "push", "seven", "paragraph", "third", "shall", "held", "hair", "describe", "cook", "floor", "either", "result", "burn", "hill", "safe", "cat", "century", "consider", "type", "law", "bit", "coast", "copy", "phrase", "silent", "tall", "sand", "soil", "roll", "temperature", "finger", "industry", "value", "fight", "lie", "beat", "excite", "natural", "view", "sense", "ear", "else", "quite", "broke", "case", "middle", "kill", "son", "lake", "moment", "scale", "loud", "spring", "observe", "child", "straight", "consonant", "nation", "dictionary", "milk", "speed", "method", "organ", "pay", "age", "section", "dress", "cloud", "surprise", "quiet", "stone", "tiny", "climb", "cool", "design", "poor", "lot", "experiment", "bottom", "key", "iron", "single", "stick", "flat", "twenty", "skin", "smile", "crease", "hole", "trade", "melody", "trip", "office", "receive", "row", "mouth", "exact", "symbol", "die", "least", "trouble", "shout", "except", "wrote", "seed", "tone", "join", "suggest", "clean", "break", "lady", "yard", "rise", "bad", "blow", "oil", "blood", "touch", "grew", "cent", "mix", "team", "wire", "cost", "lost", "brown", "wear", "garden", "equal", "sent", "choose", "fell", "fit", "flow", "fair", "bank", "collect", "save", "control", "decimal", "gentle", "woman", "captain", "practice", "separate", "difficult", "doctor", "please", "protect", "noon", "whose", "locate", "ring", "character", "insect", "caught", "period", "indicate", "radio", "spoke", "atom", "human", "history", "effect", "electric", "expect", "crop", "modern", "element", "hit", "student", "corner", "party", "supply", "bone", "rail", "imagine", "provide", "agree", "thus", "capital", "won't", "chair", "danger", "fruit", "rich", "thick", "soldier", "process", "operate", "guess", "necessary", "sharp", "wing", "create", "neighbor", "wash", "bat", "rather", "crowd", "corn", "compare", "poem", "string", "bell", "depend", "meat", "rub", "tube", "famous", "dollar", "stream", "fear", "sight", "thin", "triangle", "planet", "hurry", "chief", "colony", "clock", "mine", "tie", "enter", "major", "fresh", "search", "send", "yellow", "gun", "allow", "print", "dead", "spot", "desert", "suit", "current", "lift", "rose", "continue", "block", "chart", "hat", "sell", "success", "company", "subtract", "event", "particular", "deal", "swim", "term", "opposite", "wife", "shoe", "shoulder", "spread", "arrange", "camp", "invent", "cotton", "born", "determine", "quart", "nine", "truck", "noise", "level", "chance", "gather", "shop", "stretch", "throw", "shine", "property", "column", "molecule", "select", "wrong", "gray", "repeat", "require", "broad", "prepare", "salt", "nose", "plural", "anger", "claim", "continent", "oxygen", "sugar", "death", "pretty", "skill", "women", "season", "solution", "magnet", "silver", "thank", "branch", "match", "suffix", "especially", "fig", "afraid", "huge", "sister", "steel", "discuss", "forward", "similar", "guide", "experience", "score", "apple", "bought", "led", "pitch", "coat", "mass", "card", "band", "rope", "slip", "win", "dream", "evening", "condition", "feed", "tool", "total", "basic", "smell", "valley", "nor", "double", "seat", "arrive", "master", "track", "parent", "shore", "division", "sheet", "substance", "favor", "connect", "post", "spend", "chord", "fat", "glad", "original", "share", "station", "dad", "bread", "charge", "proper", "bar", "offer", "segment", "slave", "duck", "instant", "market", "degree", "populate", "chick", "dear", "enemy", "reply", "drink", "occur", "support", "speech", "nature", "range", "steam", "motion", "path", "liquid", "log", "meant", "quotient", "teeth", "shell", "neck"] 41 | 42 | random_entry = lambda x: x[random.randrange(len(x))] 43 | return " ".join([random_entry(nouns), random_entry(verbs), random_entry(adv), random_entry(adj), random_entry(nouns), random_entry(verbs), random_entry(adv), random_entry(adj)]) 44 | 45 | def find_between( s, first, last ): 46 | try: 47 | start = s.index( first ) + len( first ) 48 | end = s.index( last, start ) 49 | return s[start:end] 50 | except ValueError: 51 | return "" 52 | 53 | def vote_comment_post(data1, headers1): 54 | return requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/like', headers=headers1, data=data1, proxies=proxies) 55 | 56 | 57 | def vote_comment(gravityId,guid,quantity): 58 | 59 | 60 | # Select sessions from Database to upvote the comment 61 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 62 | mycursor = mydb.cursor(dictionary=True) 63 | 64 | # Select all 65 | sql = 'SELECT session FROM sessions WHERE updated_displayName != "ColnMarketCap ✔" AND banned = 0 LIMIT '+str(quantity) 66 | mycursor.execute(sql) 67 | sessions1 = mycursor.fetchall() 68 | quantityCount1 = 0 69 | 70 | 71 | 72 | # Check if Post isnt in abnormal state 73 | 74 | data1 = '{"gravityId":"'+gravityId+'","guid":"'+guid+'","like":true}' 75 | 76 | headers1 = { 77 | 'authority': 'api-gravity.coinmarketcap.com', 78 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 79 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 80 | 'sec-ch-ua-mobile': '?0', 81 | 'authorization': 'Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJyb2xlcyI6ImFjY291bnRXZWIsYWNjb3VudE1vYmlsZSIsInVpZCI6NjE5MjE3NzUsImlzcyI6ImNtYy1hdXRoIiwiaWF0IjoxNjQ1MjI3MDk5LCJzdWIiOiI2MjEwMmM1MmQxZWViZDE0ODkzYjliMGQiLCJleHAiOjE2NDc4MTkwOTl9.NHIghrZrK-80CZBxRHyYoIxR6mNBN5c2gb1ThKecvqQ', 82 | 'content-type': 'application/json;charset=UTF-8', 83 | 'accept': 'application/json, text/plain, */*', 84 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 85 | 'sec-ch-ua-platform': '"Windows"', 86 | 'origin': 'https://coinmarketcap.com', 87 | 'sec-fetch-site': 'same-site', 88 | 'sec-fetch-mode': 'cors', 89 | 'sec-fetch-dest': 'empty', 90 | 'referer': 'https://coinmarketcap.com/', 91 | } 92 | 93 | 94 | try: 95 | resp1 = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/like', headers=headers1, data=data1, proxies=proxies) 96 | #print(gravityId) 97 | #print(guid) 98 | print(str(resp1.content)+'\n') 99 | 100 | if "The replied tweet is in abnormal status." in str(resp1.content): 101 | print("POST NOT GOOD") 102 | return False 103 | else: 104 | if resp1.status_code == 200: 105 | json_data = json.loads(resp1.content) 106 | message = json_data['data']['message'] 107 | if message == 'like the crypto tweet successfully.': 108 | #print(resp1.content) 109 | print('The post is in good state.') 110 | else: 111 | print(message) 112 | else: 113 | print("UNKNOWN ERROR") 114 | print(resp1) 115 | print(resp1.content) 116 | 117 | except: 118 | print("Proxy didnt work, skipping like") 119 | 120 | 121 | headers1_array = [] 122 | 123 | for session1 in sessions1: 124 | session1 = session1['session'].strip() 125 | #print(session1) 126 | headers1 = { 127 | 'authority': 'api-gravity.coinmarketcap.com', 128 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 129 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 130 | 'sec-ch-ua-mobile': '?0', 131 | 'authorization': 'Bearer ' + session1, 132 | 'content-type': 'application/json;charset=UTF-8', 133 | 'accept': 'application/json, text/plain, */*', 134 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 135 | 'sec-ch-ua-platform': '"Windows"', 136 | 'origin': 'https://coinmarketcap.com', 137 | 'sec-fetch-site': 'same-site', 138 | 'sec-fetch-mode': 'cors', 139 | 'sec-fetch-dest': 'empty', 140 | 'referer': 'https://coinmarketcap.com/', 141 | } 142 | 143 | headers1_array.append(headers1) 144 | 145 | print("Upvoting post...") 146 | with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads 147 | response_process = [] 148 | res = [executor.submit(vote_comment_post, data1, headers1) for headers1 in headers1_array] 149 | concurrent.futures.wait(res) 150 | 151 | 152 | ''' 153 | 154 | try: 155 | resp1 = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/like', headers=headers1, data=data1, proxies=proxies) 156 | #print(gravityId) 157 | #print(guid) 158 | 159 | if "The replied tweet is in abnormal status." in str(resp1.content): 160 | return False 161 | break 162 | else: 163 | if resp1.status_code == 200: 164 | quantityCount1+=1 165 | print(resp1.content) 166 | message = find_between( str(resp1.content), 'message":"', '","data"' ) 167 | if message == 'like the crypto tweet successfully.': 168 | print("Comment upvoted x"+str(quantityCount1)) 169 | else: 170 | print(message) 171 | else: 172 | print("UNKNOWN ERROR") 173 | print(resp1) 174 | print(resp1.content) 175 | 176 | except: 177 | print("Proxy didnt work, skipping like") 178 | continue 179 | 180 | ''' 181 | 182 | 183 | 184 | def reply_comment_post(gravityId, headers2): 185 | sentence = make_random_sentence() 186 | data2 = '{"content":"'+str(sentence)+'","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(sentence)+'\\"}]]","replyToGravityId":"'+str(gravityId)+'","rootId":"'+str(gravityId)+'"}' 187 | return requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/post-crypto-tweet', headers=headers2, data=data2, proxies=proxies) 188 | 189 | 190 | def reply_comment(gravityId,quantity): 191 | 192 | sentence = make_random_sentence() 193 | 194 | # Select sessions from Database to upvote the comment 195 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 196 | mycursor = mydb.cursor(dictionary=True) 197 | 198 | # Select all 199 | sql = 'SELECT session FROM sessions WHERE updated_displayName != "ColnMarketCap ✔" AND banned = 0 LIMIT '+str(quantity) 200 | mycursor.execute(sql) 201 | sessions2 = mycursor.fetchall() 202 | quantityCount2 = 0 203 | 204 | # Check if Post isnt in abnormal state 205 | 206 | data2 = '{"content":"'+str(sentence)+'","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(sentence)+'\\"}]]","replyToGravityId":"'+str(gravityId)+'","rootId":"'+str(gravityId)+'"}' 207 | 208 | 209 | headers2 = { 210 | 'authority': 'api-gravity.coinmarketcap.com', 211 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 212 | 'accept': 'application/json, text/plain, */*', 213 | 'content-type': 'application/json;charset=UTF-8', 214 | 'authorization': 'Bearer eyJ0eXBlIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJyb2xlcyI6ImFjY291bnRXZWIsYWNjb3VudE1vYmlsZSIsInVpZCI6NjE5MjE3NzUsImlzcyI6ImNtYy1hdXRoIiwiaWF0IjoxNjQ1MjI3MDk5LCJzdWIiOiI2MjEwMmM1MmQxZWViZDE0ODkzYjliMGQiLCJleHAiOjE2NDc4MTkwOTl9.NHIghrZrK-80CZBxRHyYoIxR6mNBN5c2gb1ThKecvqQ', 215 | 'sec-ch-ua-mobile': '?0', 216 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 217 | 'sec-ch-ua-platform': '"Windows"', 218 | 'origin': 'https://coinmarketcap.com', 219 | 'sec-fetch-site': 'same-site', 220 | 'sec-fetch-mode': 'cors', 221 | 'sec-fetch-dest': 'empty', 222 | 'referer': 'https://coinmarketcap.com/', 223 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 224 | } 225 | ''' 226 | try: 227 | resp2 = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/post-crypto-tweet', headers=headers2, data=data2, proxies=proxies) 228 | 229 | if "The replied tweet is in abnormal status." in str(resp2.content): 230 | return False 231 | #break 232 | else: 233 | if resp2.status_code == 200: 234 | json_data = json.loads(resp1.content) 235 | message = json_data['data']['message'] 236 | if message == 'The cryptotweet is posted successfully.': 237 | print(resp2.content) 238 | print('The post is in good state.') 239 | else: 240 | print(message) 241 | else: 242 | print("UNKNOWN ERROR") 243 | print(resp2) 244 | print(resp2.content) 245 | 246 | except: 247 | print("Proxy didnt work, skipping reply") 248 | #continue 249 | ''' 250 | 251 | 252 | headers2_array = [] 253 | 254 | for session2 in sessions2: 255 | sentence = make_random_sentence() 256 | session2 = session2['session'].strip() 257 | 258 | headers2 = { 259 | 'authority': 'api-gravity.coinmarketcap.com', 260 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 261 | 'accept': 'application/json, text/plain, */*', 262 | 'content-type': 'application/json;charset=UTF-8', 263 | 'authorization': 'Bearer '+ session2, 264 | 'sec-ch-ua-mobile': '?0', 265 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 266 | 'sec-ch-ua-platform': '"Windows"', 267 | 'origin': 'https://coinmarketcap.com', 268 | 'sec-fetch-site': 'same-site', 269 | 'sec-fetch-mode': 'cors', 270 | 'sec-fetch-dest': 'empty', 271 | 'referer': 'https://coinmarketcap.com/', 272 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 273 | } 274 | 275 | headers2_array.append(headers2) 276 | 277 | 278 | 279 | print("Replying to post...") 280 | 281 | with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads 282 | response_process = [] 283 | ress = [executor.submit(reply_comment_post, gravityId, headers2) for headers2 in headers2_array] 284 | concurrent.futures.wait(ress) 285 | 286 | 287 | with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads 288 | response_process = [] 289 | ress = [executor.submit(reply_comment_post, gravityId, headers2) for headers2 in headers2_array] 290 | concurrent.futures.wait(ress) 291 | 292 | 293 | with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads 294 | response_process = [] 295 | ress = [executor.submit(reply_comment_post, gravityId, headers2) for headers2 in headers2_array] 296 | concurrent.futures.wait(ress) 297 | 298 | 299 | ''' 300 | for fut in ress: 301 | try: 302 | res = fut.result() 303 | print(res) 304 | except Exception: 305 | continue 306 | ''' 307 | 308 | 309 | ''' 310 | def reply_comment(gravityId,quantity): 311 | 312 | # Select sessions from Database to upvote the comment 313 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 314 | mycursor = mydb.cursor(dictionary=True) 315 | 316 | # Select all 317 | sql = 'SELECT session FROM sessions WHERE updated_displayName != "ColnMarketCap ✔" LIMIT '+str(quantity) 318 | mycursor.execute(sql) 319 | sessions2 = mycursor.fetchall() 320 | quantityCount2 = 0 321 | 322 | for session2 in sessions2: 323 | sentence = make_random_sentence() 324 | session2 = session2['session'].strip() 325 | 326 | headers2 = { 327 | 'authority': 'api-gravity.coinmarketcap.com', 328 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 329 | 'accept': 'application/json, text/plain, */*', 330 | 'content-type': 'application/json;charset=UTF-8', 331 | 'authorization': 'Bearer '+ session2, 332 | 'sec-ch-ua-mobile': '?0', 333 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 334 | 'sec-ch-ua-platform': '"Windows"', 335 | 'origin': 'https://coinmarketcap.com', 336 | 'sec-fetch-site': 'same-site', 337 | 'sec-fetch-mode': 'cors', 338 | 'sec-fetch-dest': 'empty', 339 | 'referer': 'https://coinmarketcap.com/', 340 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 341 | } 342 | 343 | data2 = '{"content":"'+str(sentence)+'","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(sentence)+'\\"}]]","replyToGravityId":"'+str(gravityId)+'","rootId":"'+str(gravityId)+'"}' 344 | 345 | try: 346 | resp2 = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/post-crypto-tweet', headers=headers2, data=data2, proxies=proxies) 347 | #print(gravityId) 348 | #print(guid) 349 | 350 | if "The replied tweet is in abnormal status." in str(resp2.content): 351 | return False 352 | break 353 | else: 354 | if resp2.status_code == 200: 355 | quantityCount2+=1 356 | message = find_between( str(resp2.content), 'message":"', '","data"' ) 357 | if message == 'The cryptotweet is posted successfully.': 358 | print("Comment replied x"+str(quantityCount2)) 359 | else: 360 | print(message) 361 | else: 362 | print("UNKNOWN ERROR") 363 | print(resp2) 364 | print(resp2.content) 365 | 366 | except: 367 | print("Proxy didnt work, skipping like") 368 | continue 369 | 370 | ''' 371 | 372 | 373 | def shuffle(string): 374 | for x in range(len(string)): 375 | pos = randint(0, len(string) - 1) # pick random position to insert char 376 | string = "".join((string[:pos], '­', string[pos:])) # insert char at pos 377 | 378 | return(str(string)) 379 | 380 | 381 | 382 | def comment(session,user_id,tokenid,tokenurl,tokenname): 383 | print('##################################################') 384 | 385 | comment_done = False 386 | 387 | while comment_done == False: 388 | try: 389 | r = requests.get('http://jsonip.com', proxies=proxies) 390 | except: 391 | print("Proxy didnt work, restarting comment") 392 | continue 393 | 394 | ip = r.json()['ip'] 395 | 396 | print('Your IP is '+str(ip)) 397 | print("Using account: " + str(user_id)) 398 | print("Crypto Token URL: " + str(tokenurl)+ "\n") 399 | 400 | ''' 401 | headers = { 402 | 'authority': 'api-gravity.coinmarketcap.com', 403 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 404 | 'accept': 'application/json, text/plain, */*', 405 | 'content-type': 'application/json;charset=UTF-8', 406 | 'authorization': 'Bearer '+str(session), 407 | 'sec-ch-ua-mobile': '?0', 408 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 409 | 'sec-ch-ua-platform': '"Windows"', 410 | 'origin': 'https://coinmarketcap.com', 411 | 'sec-fetch-site': 'same-site', 412 | 'sec-fetch-mode': 'cors', 413 | 'sec-fetch-dest': 'empty', 414 | 'referer': 'https://coinmarketcap.com/', 415 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 416 | } 417 | 418 | 419 | data = '{"bullish":true,"content":"'+str(line1)+'","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(line1)+'\\"}],[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(line2)+'\\"}],[{\\"type\\":\\"token\\",\\"children\\":[{\\"text\\":\\"\\"}],\\"content\\":{\\"id\\":'+str(tokenid)+',\\"slug\\":\\"\\",\\"symbol\\":\\"\\"}}]]","links":[],"currencies":[{"id":'+str(tokenid)+',"slug":"","symbol":""}]}' 420 | resp = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/post-crypto-tweet', headers=headers, data=data, proxies=proxies) 421 | 422 | ''' 423 | headers = { 424 | 'authority': 'api-gravity.coinmarketcap.com', 425 | 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="98", "Google Chrome";v="98"', 426 | 'accept-language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6', 427 | 'sec-ch-ua-mobile': '?0', 428 | 'authorization': 'Bearer '+str(session), 429 | 'content-type': 'application/json;charset=UTF-8', 430 | 'accept': 'application/json, text/plain, */*', 431 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', 432 | 'sec-ch-ua-platform': '"Windows"', 433 | 'origin': 'https://coinmarketcap.com', 434 | 'sec-fetch-site': 'same-site', 435 | 'sec-fetch-mode': 'cors', 436 | 'sec-fetch-dest': 'empty', 437 | 'referer': 'https://coinmarketcap.com/', 438 | } 439 | tokenNameUpper = str(tokenname.upper().strip()) 440 | 441 | # "✅ ATTENTION: 55OO+ ETH GIVE" , "✅ OFFICIAL GI­VEA­WAY!" 442 | line1_array = ["✅✅ FREE "+tokenNameUpper+" GIVEAWAY 🔥"] 443 | line2_array = ["Go and get ➡️ ­C­o­i­n­M­a­r­k­e­t­G­i­v­e­.­c­o­m­","Go to ➡️ ­C­o­i­n­M­a­r­k­e­t­G­i­v­e­.­c­o­m­","Details ➡️ ­C­o­i­n­M­a­r­k­e­t­G­i­v­e­.­c­o­m­"] 444 | line3_array = ["Copy and search! 🔥🔥", "Ending soon! ⌛🔥", "Ends on 23rd of February ⌛🔥", "Ending very soon! ⌛🔥"] 445 | 446 | 447 | 448 | line1 = random.choice(line1_array) 449 | line2 = random.choice(line2_array) 450 | line3 = random.choice(line3_array) 451 | 452 | 453 | #print(line1) 454 | #print(line2) 455 | #print(line3 + "\n") 456 | 457 | line1 = shuffle(random.choice(line1_array)) 458 | line2 = shuffle(random.choice(line2_array)) 459 | line3 = shuffle(random.choice(line3_array)) 460 | 461 | 462 | 463 | data = '{"bullish":true,"content":" ","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(line1)+'\\"}],[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(line2)+'\\"}],[{\\"type\\":\\"text\\",\\"content\\":\\"'+str(line3)+'\\"}],[{\\"type\\":\\"token\\",\\"children\\":[{\\"text\\":\\"\\"}],\\"content\\":{\\"id\\":'+str(tokenid)+',\\"slug\\":\\"\\",\\"symbol\\":\\"\\"}}]]","links":[],"currencies":[{"id":'+str(tokenid)+',"slug":"","symbol":""}]}' 464 | data = data.encode('utf-8') 465 | 466 | #data = '{"bullish":true,"content":" ","originalContent":"[[{\\"type\\":\\"text\\",\\"content\\":\\"98sayd9a 8sd89a9sdhy9 asd9asVE)\\"}],[{\\"type\\":\\"text\\",\\"content\\":\\"9asjhd9sah9das9d a9s8h 8as\\"}],[{\\"type\\":\\"token\\",\\"children\\":[{\\"text\\":\\"\\"}],\\"content\\":{\\"id\\":'+str(tokenid)+',\\"slug\\":\\"\\",\\"symbol\\":\\"\\"}}]]","links":[],"currencies":[{"id":'+str(tokenid)+',"slug":"","symbol":""}]}' 467 | 468 | resp = requests.post('https://api-gravity.coinmarketcap.com/gravity/v3/gravity/post-crypto-tweet', headers=headers, data=data, proxies=proxies) 469 | 470 | print(str(resp.content)+'\n') 471 | json_data = json.loads(resp.content) 472 | dateNow = datetime.now() 473 | 474 | # If can't get Post details then POST wasnt sucessfull and user is ratelimited 475 | try: 476 | gravityId = json_data['data']['data']['gravityId'] 477 | guid = json_data['data']['data']['owner']['guid'] 478 | except KeyError: 479 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc") 480 | mycursor = mydb.cursor() 481 | sql = 'UPDATE sessions SET banned = %s, banned_at = %s WHERE id = %s' 482 | values = [int(1),dateNow,int(user_id)] 483 | mycursor.execute(sql, values) 484 | mydb.commit() 485 | 486 | print("Account Banned!!") 487 | break 488 | 489 | 490 | 491 | # Save Comment Log to MYSQL Database 492 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc") 493 | mycursor = mydb.cursor() 494 | 495 | 496 | sql = "INSERT INTO comments_log (user_id, date_created, content, gravityId, guid) VALUES (%s, %s, %s, %s, %s)" 497 | val = (str(user_id) , str(dateNow), str(data.decode('utf-8')), gravityId, guid) 498 | mycursor.execute(sql, val) 499 | 500 | mydb.commit() 501 | #print("Comment saved into Database with ID: ", mycursor.lastrowid) 502 | 503 | #Check if current user made more than X comments in the last 24 hours 504 | 505 | sql = 'SELECT COUNT(*) FROM comments_log WHERE user_id = '+ str(user_id)+' AND date_created >= NOW() - INTERVAL 1 DAY' 506 | mycursor.execute(sql) 507 | count_rows = mycursor.fetchone() 508 | count_rows = count_rows[0] 509 | 510 | if resp.status_code == 200: 511 | print("Comment done.") 512 | #print(resp.content) 513 | 514 | print("Daily limit: "+str(count_rows)+"/3 comments") 515 | 516 | #Set daily limit as true 517 | if count_rows > 2: 518 | sql = 'UPDATE sessions SET daily_limit = %s, daily_limit_at = %s WHERE id = %s' 519 | values = [int(1),dateNow,int(user_id)] 520 | mycursor.execute(sql, values) 521 | mydb.commit() 522 | print('User reached Daily limit!') 523 | 524 | 525 | if vote_comment(gravityId,guid,3700) == False: 526 | 527 | #sql = 'UPDATE sessions SET ratelimited = %s, ratelimited_at = %s WHERE id = %s' 528 | #values = [int(1),dateNow,int(user_id)] 529 | #mycursor.execute(sql, values) 530 | #mydb.commit() 531 | 532 | print("Comment with abnormal status, retrying in 30 sec...") 533 | comment_done = False 534 | 535 | time.sleep(5) 536 | 537 | else: 538 | reply_comment(gravityId,3700) 539 | comment_done = True 540 | print("") 541 | print("Commented, replied & upvoted DONE!!") 542 | print('##################################################') 543 | 544 | 545 | 546 | else: 547 | print("UNKNOWN ERROR") 548 | 549 | 550 | with open("tokens.txt", encoding="utf-8") as file_in: 551 | tokens = [] 552 | for line in file_in: 553 | tokens.append(line) 554 | 555 | nickname = "ColnMarketCap ✔" 556 | 557 | numberCount = 0 558 | 559 | #tokens = tokens[start:] 560 | #tokens = tokens[:end] 561 | 562 | for token in tokens: 563 | numberCount+=1 564 | print("RUN NUMBER: "+str(numberCount)) 565 | token = token.split("|") 566 | 567 | tokenid = token[0] 568 | tokenurl = token[1] 569 | tokenname = token[2] 570 | 571 | # Select sessions from Database 572 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 573 | mycursor = mydb.cursor(dictionary=True) 574 | 575 | # Select Session to comment 576 | if nickname == "all": 577 | sql = 'SELECT session, id FROM sessions WHERE updated_displayName != "ColnMarketCap ✔" AND banned = 0 AND ratelimited = 0 AND (daily_limit_at < (NOW() - INTERVAL 1 DAY) OR daily_limit_at IS NULL) LIMIT 1' 578 | mycursor.execute(sql) 579 | sessions = mycursor.fetchall() 580 | else: 581 | sql = 'SELECT session, id FROM sessions WHERE id > 200 AND updated_displayName = "'+str(nickname)+'" AND banned = 0 AND ratelimited = 0 AND (daily_limit_at < (NOW() - INTERVAL 1 DAY) OR daily_limit_at IS NULL) LIMIT 1' 582 | mycursor.execute(sql) 583 | sessions = mycursor.fetchall() 584 | 585 | #print(sessions) 586 | # Get comment content to comment 587 | #sql = 'SELECT content FROM comments LIMIT 1' 588 | #mycursor.execute(sql) 589 | #comments = mycursor.fetchall() 590 | 591 | 592 | for session in sessions: 593 | comment(session['session'].strip(),session['id'],tokenid,tokenurl,tokenname) 594 | 595 | 596 | print("FINISHED EVERYTHING!!!!!") 597 | -------------------------------------------------------------------------------- /gettokenids.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import requests 3 | from requests.structures import CaseInsensitiveDict 4 | import mysql.connector 5 | from datetime import datetime 6 | import random 7 | from random import randrange 8 | from random import randint 9 | import time 10 | import concurrent.futures 11 | from lxml import html 12 | import json 13 | 14 | proxies = { 'https': 'http://lum-customer-hl_9cfd00a8-zone-data_center:bkq47uq0w1mp@zproxy.lum-superproxy.io:22225', 'http': 'http://lum-customer-hl_9cfd00a8-zone-data_center:bkq47uq0w1mp@zproxy.lum-superproxy.io:22225' } 15 | 16 | 17 | def find_between( s, first, last ): 18 | try: 19 | start = s.index( first ) + len( first ) 20 | end = s.index( last, start ) 21 | return s[start:end] 22 | except ValueError: 23 | return "" 24 | 25 | 26 | for pageNumber in range(1,95): 27 | if pageNumber == 1: 28 | start = 1 29 | else: 30 | start = (pageNumber - 1) * 100 31 | 32 | page = 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start='+str(start)+'&limit=100&sortBy=market_cap&sortType=desc&convert=USD,BTC,ETH&cryptoType=all&tagType=all&audited=false&aux=ath,atl,high24h,low24h,num_market_pairs,cmc_rank,date_added,max_supply,circulating_supply,total_supply,volume_7d,volume_30d,self_reported_circulating_supply,self_reported_market_cap' 33 | resp = requests.get(page) 34 | json_data = json.loads(resp.text) 35 | 36 | for x in range(100): 37 | tokenId = json_data['data']['cryptoCurrencyList'][x]['id'] 38 | tokenName = json_data['data']['cryptoCurrencyList'][x]['name'] 39 | tokenName1 = tokenName.replace(".", "-") 40 | tokenUrl = 'https://coinmarketcap.com/currencies/'+str(tokenName1.replace(" ", "-")).lower() 41 | 42 | with open('tokens.txt', 'a', encoding="utf-8") as file: 43 | file.write(str(tokenId)+'|'+tokenUrl+'|'+tokenName+'\n') 44 | 45 | ''' 46 | 47 | # Request the page 48 | 49 | 50 | for url in URLS: 51 | page = requests.get(url) 52 | 53 | # Parsing the page 54 | tree = html.fromstring(page.content) 55 | print(tree) 56 | # Get element using XPath 57 | shares = tree.xpath("//*[contains(@class,'coin-logo')]/@src") 58 | #print(share) 59 | with open('cmc.txt', 'a') as file: 60 | file.write(str(shares)) 61 | 62 | for share in shares: 63 | print(share) 64 | 65 | 66 | 67 | def getData(url): 68 | res = requests.get(url) 69 | try: 70 | return res.json() 71 | except: 72 | return res.text 73 | with futures.ThreadPoolExecutor(max_workers=5) as executor: 74 | res = executor.map(getData,URLS) 75 | responses = list(res) ## your list will already be pre-formated 76 | with open('cmc.txt', 'a') as file: 77 | file.write(str(responses)) 78 | ''' -------------------------------------------------------------------------------- /piece1_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/piece1_result.jpg -------------------------------------------------------------------------------- /piece2_result.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Supernova1024/39Coinmarket-Comment-Python/0c5179274a8b279bbc6024852dcd5be4d26a3cae/piece2_result.jpg -------------------------------------------------------------------------------- /signup.py: -------------------------------------------------------------------------------- 1 | import time 2 | import cv2 3 | import random 4 | import numpy as np 5 | import pyautogui 6 | import bezier 7 | import requests 8 | import os 9 | import re 10 | import sys 11 | import json 12 | import names 13 | import pickle 14 | import mysql.connector 15 | 16 | 17 | from datetime import datetime 18 | from requests import get 19 | from fake_useragent import UserAgent 20 | from requests.structures import CaseInsensitiveDict 21 | 22 | from seleniumwire.undetected_chromedriver.v2 import Chrome 23 | 24 | from selenium.webdriver.chrome.options import Options 25 | 26 | from selenium.webdriver.chrome.service import Service 27 | from selenium.webdriver.common.by import By 28 | from selenium.webdriver import ActionChains 29 | from selenium.webdriver.common.action_chains import ActionChains 30 | from selenium.webdriver.common.keys import Keys 31 | from selenium.webdriver.support import expected_conditions as EC 32 | from selenium.common.exceptions import NoSuchElementException 33 | from selenium.webdriver.support.ui import WebDriverWait 34 | 35 | import Xlib.display 36 | pyautogui._pyautogui_x11._display = Xlib.display.Display(os.environ['DISPLAY']) 37 | 38 | # Disable pyautogui pauses 39 | pyautogui.MINIMUM_DURATION = 0 40 | pyautogui.MINIMUM_SLEEP = 0 41 | pyautogui.PAUSE = 0 42 | 43 | def delete_cache(): 44 | driver.execute_script("window.open('');") 45 | time.sleep(2) 46 | driver.switch_to.window(driver.window_handles[-1]) 47 | time.sleep(2) 48 | driver.get('chrome://settings/clearBrowserData') # for old chromedriver versions use cleardriverData 49 | time.sleep(2) 50 | actions = ActionChains(driver) 51 | actions.send_keys(Keys.TAB * 3 + Keys.DOWN * 3) # send right combination 52 | actions.perform() 53 | time.sleep(2) 54 | actions = ActionChains(driver) 55 | actions.send_keys(Keys.TAB * 4 + Keys.ENTER) # confirm 56 | actions.perform() 57 | time.sleep(5) # wait some time to finish 58 | driver.close() # close this tab 59 | driver.switch_to.window(driver.window_handles[0]) # switch back 60 | 61 | # Get captcha solution 62 | def lower_right_piece1(): 63 | bg_img = cv2.imread('captcha/captcha.png') 64 | tp_img = cv2.imread('captcha/piece1.png') 65 | 66 | bg_pic = bg_img 67 | tp_pic = tp_img 68 | 69 | res = cv2.matchTemplate(bg_pic, tp_pic, cv2.TM_CCOEFF_NORMED) 70 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) # Looking for the best match 71 | 72 | X = max_loc[0] 73 | 74 | th, tw = tp_pic.shape[:2] 75 | tl = max_loc # The coordinates of the upper left corner 76 | br = (tl[0]+tw,tl[1]+th) # The coordinates of the lower right corner 77 | cv2.rectangle(bg_img, tl, br, (0, 0, 255), 2) # Draw a rectangle 78 | cv2.imwrite('piece1_result.jpg', bg_img) # Keep it locally 79 | return(br) 80 | 81 | def lower_right_piece2(): 82 | bg_img = cv2.imread('captcha/captcha.png') 83 | tp_img = cv2.imread('captcha/piece2.png') 84 | 85 | bg_pic = bg_img 86 | tp_pic = tp_img 87 | 88 | res = cv2.matchTemplate(bg_pic, tp_pic, cv2.TM_CCOEFF_NORMED) 89 | min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(res) # Looking for the best match 90 | 91 | X = max_loc[0] 92 | 93 | th, tw = tp_pic.shape[:2] 94 | tl = max_loc # The coordinates of the upper left corner 95 | br = (tl[0]+tw,tl[1]+th) # The coordinates of the lower right corner 96 | cv2.rectangle(bg_img, tl, br, (0, 0, 255), 2) # Draw a rectangle 97 | cv2.imwrite('piece2_result.jpg', bg_img) # Keep it locally 98 | return(br) 99 | 100 | def slow_type(pageElem, pageInput): 101 | for letter in pageInput: 102 | time.sleep(float(random.uniform(.05, .3))) 103 | pageElem.send_keys(letter) 104 | 105 | def bezier_mouse(location, size, panelHeight): ##move mouse to middle of element 106 | x, relY = location["x"], location["y"] ##abs X and relative Y 107 | absY = relY + panelHeight 108 | w, h = size["width"], size["height"] 109 | wCenter = w/2 110 | hCenter = h/2 111 | xCenter = int(wCenter + x) 112 | yCenter = int(hCenter + absY) 113 | 114 | start = pyautogui.position() 115 | end = xCenter, yCenter 116 | 117 | x2 = (start[0] + end[0]) / 2 #midpoint x 118 | y2 = (start[1] + end[1]) / 2 ##midpoint y 119 | 120 | control1X = (start[0] + x2) / 2 121 | control1Y = (end[1] + y2) / 2 122 | 123 | control2X = (end[0] + x2) / 2 124 | control2Y = (start[1] + y2) / 2 125 | 126 | # Two intermediate control points that may be adjusted to modify the curve. 127 | control1 = control1X, y2 ##combine midpoints to create perfect curve 128 | control2 = control2X, y2 129 | 130 | # Format points to use with bezier 131 | control_points = np.array([start, control1, control2, end]) 132 | points = np.array([control_points[:, 0], control_points[:, 1]]) # Split x and y coordinates 133 | 134 | # You can set the degree of the curve here, should be less than # of control points 135 | degree = 3 136 | 137 | # Create the bezier curve 138 | curve = bezier.Curve(points, degree) 139 | 140 | curve_steps = 50 # How many points the curve should be split into. Each is a separate pyautogui.moveTo() execution 141 | delay = 0.003 # Time between movements. 1/curve_steps = 1 second for entire curve 142 | 143 | # Move the mouse 144 | for j in range(1, curve_steps + 1): 145 | # The evaluate method takes a float from [0.0, 1.0] and returns the coordinates at that point in the curve 146 | # Another way of thinking about it is that i/steps gets the coordinates at (100*i/steps) percent into the curve 147 | x, y = curve.evaluate(j / curve_steps) 148 | pyautogui.moveTo(x, y) # Move to point in curve 149 | pyautogui.sleep(delay) # Wait delay 150 | 151 | 152 | def bezier_mouse_x_y(locationX, locationY, size, panelHeight): ##move mouse to middle of element 153 | x, relY = locationX, locationY ##abs X and relative Y 154 | absY = relY + panelHeight 155 | w, h = size["width"], size["height"] 156 | wCenter = w/2 157 | hCenter = h/2 158 | xCenter = int(wCenter + x) 159 | yCenter = int(hCenter + absY) 160 | 161 | start = pyautogui.position() 162 | end = xCenter, yCenter 163 | 164 | x2 = (start[0] + end[0]) / 2 #midpoint x 165 | y2 = (start[1] + end[1]) / 2 ##midpoint y 166 | 167 | control1X = (start[0] + x2) / 2 168 | control1Y = (end[1] + y2) / 2 169 | 170 | control2X = (end[0] + x2) / 2 171 | control2Y = (start[1] + y2) / 2 172 | 173 | # Two intermediate control points that may be adjusted to modify the curve. 174 | control1 = control1X, y2 ##combine midpoints to create perfect curve 175 | control2 = control2X, y2 176 | 177 | # Format points to use with bezier 178 | control_points = np.array([start, control1, control2, end]) 179 | points = np.array([control_points[:, 0], control_points[:, 1]]) # Split x and y coordinates 180 | 181 | # You can set the degree of the curve here, should be less than # of control points 182 | degree = 3 183 | 184 | # Create the bezier curve 185 | curve = bezier.Curve(points, degree) 186 | 187 | curve_steps = 50 # How many points the curve should be split into. Each is a separate pyautogui.moveTo() execution 188 | delay = 0.003 # Time between movements. 1/curve_steps = 1 second for entire curve 189 | 190 | # Move the mouse 191 | for j in range(1, curve_steps + 1): 192 | # The evaluate method takes a float from [0.0, 1.0] and returns the coordinates at that point in the curve 193 | # Another way of thinking about it is that i/steps gets the coordinates at (100*i/steps) percent into the curve 194 | x, y = curve.evaluate(j / curve_steps) 195 | pyautogui.moveTo(x, y) # Move to point in curve 196 | pyautogui.sleep(delay) # Wait delay 197 | 198 | def resting_mouse(): #move mouse to right of screen 199 | 200 | start = pyautogui.position() 201 | end = random.randint(1600,1750), random.randint(400,850) 202 | 203 | x2 = (start[0] + end[0])/2 #midpoint x 204 | y2 = (start[1] + end[1]) / 2 ##midpoint y 205 | 206 | control1X = (start[0] + x2)/2 207 | control2X = (end[0] + x2) / 2 208 | 209 | # Two intermediate control points that may be adjusted to modify the curve. 210 | control1 = control1X, y2 ##combine midpoints to create perfect curve 211 | control2 = control2X, y2 ## using y2 for both to get a more linear curve 212 | 213 | # Format points to use with bezier 214 | control_points = np.array([start, control1, control2, end]) 215 | points = np.array([control_points[:, 0], control_points[:, 1]]) # Split x and y coordinates 216 | # You can set the degree of the curve here, should be less than # of control points 217 | degree = 3 218 | # Create the bezier curve 219 | curve = bezier.Curve(points, degree) 220 | 221 | curve_steps = 50 # How many points the curve should be split into. Each is a separate pyautogui.moveTo() execution 222 | delay = 0.003 # Time between movements. 1/curve_steps = 1 second for entire curve 223 | 224 | # Move the mouse 225 | for j in range(1, curve_steps + 1): 226 | # The evaluate method takes a float from [0.0, 1.0] and returns the coordinates at that point in the curve 227 | # Another way of thinking about it is that i/steps gets the coordinates at (100*i/steps) percent into the curve 228 | x, y = curve.evaluate(j / curve_steps) 229 | pyautogui.moveTo(x, y) # Move to point in curve 230 | pyautogui.sleep(delay) # Wait delay 231 | time.sleep(2) 232 | 233 | def find_between( s, first, last ): 234 | try: 235 | start = s.index( first ) + len( first ) 236 | end = s.index( last, start ) 237 | return s[start:end] 238 | except ValueError: 239 | return "" 240 | 241 | 242 | #with open("http_proxies.txt") as file_in: 243 | # proxies = [] 244 | # for line in file_in: 245 | # proxies.append(line) 246 | 247 | 248 | 249 | 250 | #Start Creating CMC Accounts 251 | def main(currentRunNumber,quantityOfAccounts): 252 | 253 | if __name__ == "__main__": 254 | 255 | while currentRunNumber in range(quantityOfAccounts): 256 | currentRunNumber+=1 257 | print("---------------------------------------------") 258 | print("Run number: "+str(currentRunNumber)+"/"+str(quantityOfAccounts)) 259 | print("---------------------------------------------") 260 | restart_script = 0 261 | 262 | 263 | 264 | 265 | 266 | ua = UserAgent() 267 | user_agent = ua.chrome 268 | 269 | #options.add_argument("user-agent="+user_agent) 270 | #print("User Agent: "+user_agent) 271 | 272 | 273 | # SETUP PROXY WITH AUTHENTICATION 274 | seleniumwire_options = { 275 | 'proxy': { 276 | 'http': 'http://oxyTragas:YYTtagxasdS@4g.iproyal.com:6061', 277 | 'https': 'https://oxyTragas:YYTtagxasdS@4g.iproyal.com:6061', 278 | 'no_proxy': 'localhost,127.0.0.1' 279 | } 280 | } 281 | 282 | 283 | # SETUP PROXY WITHOUT AUTHENTICATION 284 | #seleniumwire_options = { 285 | # 'proxy': { 286 | # 'http': 'http://l3atf69o:hA8jRsjokxDzzQoi_country-UnitedStates@proxy.proxy-cheap.com:31112', 287 | # 'https': 'https://l3atf69o:hA8jRsjokxDzzQoi_country-UnitedStates@proxy.proxy-cheap.com:31112', 288 | # 'no_proxy': 'localhost,127.0.0.1' 289 | # } 290 | #} 291 | 292 | 293 | options = Options() 294 | #PROXY = "195.154.255.118:15001" 295 | #options.add_argument('--proxy-server=%s' % PROXY) 296 | options.add_argument('--window-size=1980,1980') 297 | #options.add_argument('--headless') 298 | 299 | # FOR PROXY WITH AUTHENTICATION 300 | driver = Chrome(seleniumwire_options=seleniumwire_options, options=options) 301 | 302 | #driver = Chrome(options=options) 303 | driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") 304 | 305 | #Create a Random Email hash 306 | 307 | 308 | first_name = names.get_first_name() 309 | last_name = names.get_last_name() 310 | 311 | 312 | half_length_last = round(len(str(last_name))/2) 313 | half_length_first = round(len(str(first_name))/2) 314 | 315 | half_last_name = last_name[:half_length_last] 316 | half_first_name = first_name[:half_length_first] 317 | 318 | hash_array = [] 319 | 320 | hasha1 = first_name + last_name + str(random.randint(0,999)) 321 | hasha2 = first_name + str(random.randint(0,999)) + last_name 322 | hasha3 = str(random.randint(0,999)) + first_name + last_name 323 | 324 | hasha4 = first_name + half_last_name + str(random.randint(0,999)) 325 | hasha5 = first_name + str(random.randint(0,999)) + half_last_name 326 | hasha6 = str(random.randint(0,999)) + first_name + half_last_name 327 | 328 | hasha7 = half_first_name + last_name + str(random.randint(0,999)) 329 | hasha8 = half_first_name + str(random.randint(0,999)) + last_name 330 | hasha9 = str(random.randint(0,999)) + half_first_name + last_name 331 | 332 | hasha10 = half_first_name + half_last_name + str(random.randint(0,999)) 333 | hasha11 = half_first_name + str(random.randint(0,999)) + half_last_name 334 | hasha12 = str(random.randint(0,999)) + half_first_name + half_last_name 335 | 336 | hasha13 = first_name + last_name + str(random.randint(0,99)) 337 | hasha14 = last_name + first_name + str(random.randint(0,99)) 338 | hasha15 = half_first_name + half_last_name + str(random.randint(0,99)) 339 | hasha16 = half_last_name + half_first_name + str(random.randint(0,99)) 340 | 341 | 342 | hash_array.append(hasha1) 343 | hash_array.append(hasha2) 344 | hash_array.append(hasha3) 345 | hash_array.append(hasha4) 346 | hash_array.append(hasha5) 347 | hash_array.append(hasha6) 348 | hash_array.append(hasha7) 349 | hash_array.append(hasha8) 350 | hash_array.append(hasha9) 351 | hash_array.append(hasha10) 352 | hash_array.append(hasha11) 353 | hash_array.append(hasha13) 354 | hash_array.append(hasha14) 355 | hash_array.append(hasha15) 356 | hash_array.append(hasha16) 357 | 358 | 359 | 360 | 361 | hasha = random.choice(hash_array).lower() 362 | 363 | print("Email: "+str(hasha)+"@nomadside.com") 364 | 365 | erase_cache_cookies = 0 366 | 367 | if erase_cache_cookies == 1: 368 | print("Clearing Cookies and Cache...") 369 | driver.delete_all_cookies() 370 | delete_cache() 371 | 372 | 373 | #Get Proxy IP 374 | 375 | try: 376 | driver.set_page_load_timeout(30) 377 | driver.get('http://api.ipify.org/') 378 | except Exception: 379 | print("Exception occured: 0") 380 | print('Page Loading forever, pressing ESC to stop loading') 381 | pyautogui.press('esc') 382 | 383 | 384 | try: 385 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.TAG_NAME, "body"))) 386 | except Exception: 387 | print("Exception occured: 9") 388 | driver.quit() 389 | continue 390 | 391 | ip = driver.find_element(By.TAG_NAME, "body").text 392 | 393 | print('Proxy: {}'.format(ip)) 394 | print("---------------------------------------------") 395 | 396 | #Enter Coinmarketcap 397 | 398 | try: 399 | driver.set_page_load_timeout(60) 400 | url='https://coinmarketcap.com/methodology/' 401 | driver.get(url) 402 | except Exception: 403 | print("Exception occured: 1") 404 | print('Page Loading forever, pressing ESC to stop loading') 405 | pyautogui.press('esc') 406 | 407 | url='http://ip-api.com/json' 408 | 409 | panelHeight = driver.execute_script("return window.outerHeight - window.innerHeight") 410 | 411 | print("Signing up...") 412 | 413 | try: 414 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="__next"]/div[1]/div[1]/div[1]/div[2]/button[2]'))) 415 | except Exception: 416 | print("Exception occured: 2") 417 | driver.quit() 418 | continue 419 | 420 | botaocriarconta1 = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[1]/div[2]/button[2]') 421 | #bezier_mouse(botaocriarconta1.location, botaocriarconta1.size , panelHeight) 422 | botaocriarconta1.click() 423 | 424 | #resting_mouse() 425 | try: 426 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[2]/div/div/div/div[3]/input"))) 427 | except Exception: 428 | print("Exception occured: 3") 429 | driver.quit() 430 | continue 431 | 432 | inputemail = driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/div[3]/input') 433 | #bezier_mouse(inputemail.location, inputemail.size , panelHeight) 434 | #time.sleep(float(random.uniform(.05, .3))) 435 | inputemail.click() 436 | 437 | email = str(hasha)+"@nomadside.com" 438 | 439 | inputemail.send_keys(email) 440 | #slow_type(driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/div[3]/input'),email) 441 | #resting_mouse() 442 | 443 | #time.sleep(float(random.uniform(.05, .3))) 444 | inputpassword = driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/div[4]/div[2]/input') 445 | #bezier_mouse(inputpassword.location, inputpassword.size , panelHeight) 446 | #time.sleep(float(random.uniform(.05, .3))) 447 | inputpassword.click() 448 | #resting_mouse() 449 | 450 | password = "Cmcforever3218" 451 | 452 | #slow_type(driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/div[4]/div[2]/input'),password) 453 | inputpassword.send_keys(password) 454 | 455 | 456 | captcha_attempts = 0 457 | captcha_solved = 0 458 | 459 | network_error = 0 460 | 461 | while captcha_solved == 0: 462 | 463 | if network_error == 1: 464 | print("Rotating Proxy!") 465 | url = "https://dashboard.iproyal.com/4g-mobile-proxies/rotate-ip/lithuanian/begVEeOcP" 466 | 467 | payload={} 468 | headers = { 469 | 'Content-Type': 'application/json' 470 | } 471 | 472 | response = requests.request("GET", url, headers=headers, data=payload) 473 | restart_script = 1 474 | print(response.text) 475 | print("Restarting for proxy to rotate!") 476 | #print("Waiting 1 minute before running script again to let proxy rotate automaticaly!") 477 | #time.sleep(60) 478 | break 479 | 480 | 481 | if captcha_attempts == 0: 482 | print("Solving Captcha...") 483 | 484 | captcha_attempts+=1 485 | 486 | botaocriarconta = driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/div[6]/button') 487 | #bezier_mouse(botaocriarconta.location, botaocriarconta.size , panelHeight) 488 | #time.sleep(float(random.uniform(.05, .3))) 489 | #pyautogui.click() 490 | botaocriarconta.click() 491 | #resting_mouse() 492 | #time.sleep(float(random.uniform(.05, .3))) 493 | 494 | if captcha_attempts > 1: 495 | print("Solving Captcha... x"+str(captcha_attempts)) 496 | 497 | if captcha_attempts == 4: 498 | print("Too many failled captcha retries, reestarting bot!") 499 | print("Rotating Proxy!") 500 | url = "https://dashboard.iproyal.com/4g-mobile-proxies/rotate-ip/lithuanian/begVEeOcP" 501 | 502 | payload={} 503 | headers = { 504 | 'Content-Type': 'application/json' 505 | } 506 | 507 | response = requests.request("GET", url, headers=headers, data=payload) 508 | restart_script = 1 509 | print(response.text) 510 | print("Restarting for proxy to rotate!") 511 | #print("Waiting 1 minute before running script again to let proxy rotate automaticaly!") 512 | #time.sleep(60) 513 | break 514 | 515 | 516 | 517 | try: 518 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[4]/div/div[2]/div[1]"))) 519 | except Exception: 520 | print("Exception occured: 4") 521 | break 522 | 523 | time.sleep(3) 524 | # Screenshot Captcha and save it as captcha.png for OCR 525 | with open('captcha/captcha.png', 'wb') as file: 526 | file.write(driver.find_element(By.XPATH,'/html/body/div[4]/div/div[2]/div[1]').screenshot_as_png) 527 | time.sleep(5) 528 | 529 | piece1 = lower_right_piece1() 530 | piece2 = lower_right_piece2() 531 | 532 | difference = piece2[0]-piece1[0] 533 | 534 | try: 535 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, "html/body/div[4]/div/div[2]/div[1]/div"))) 536 | except Exception: 537 | print("Exception occured: 10") 538 | break 539 | 540 | source1 = driver.find_element(By.XPATH,'html/body/div[4]/div/div[2]/div[1]/div') 541 | bezier_mouse(source1.location, source1.size , panelHeight) 542 | time.sleep(float(random.uniform(.05, .3))) 543 | pyautogui.mouseDown() 544 | 545 | # Random Movements before dropping the puzzle piece to mimic human behaviour 546 | 547 | locationX = source1.location["x"] + difference 548 | locationY = source1.location["y"] + random.randint(1,15) 549 | 550 | locationX_2 = source1.location["x"] + difference + random.randint(15,150) 551 | locationY_2 = source1.location["y"] + random.randint(-150,-45) 552 | 553 | locationX_3 = source1.location["x"] + difference - random.randint(15,150) 554 | locationY_3 = source1.location["y"] + random.randint(30,100) 555 | 556 | locationX_4 = source1.location["x"] + difference + random.randint(15,150) 557 | locationY_4 = source1.location["y"] + random.randint(-50,-15) 558 | 559 | locationX_5 = source1.location["x"] + difference + random.randint(-50,50) 560 | locationY_5 = source1.location["y"] + random.randint(7,28) 561 | 562 | 563 | 564 | bezier_mouse_x_y(locationX_2, locationY_2, source1.size , panelHeight) 565 | time.sleep(float(random.uniform(.05, .3))) 566 | bezier_mouse_x_y(locationX_3, locationY_3, source1.size , panelHeight) 567 | time.sleep(float(random.uniform(.05, .3))) 568 | bezier_mouse_x_y(locationX_4, locationY_4, source1.size , panelHeight) 569 | 570 | bezier_mouse_x_y(locationX, locationY, source1.size , panelHeight) 571 | 572 | 573 | #pyautogui.move(difference, 0) 574 | 575 | pyautogui.mouseUp() 576 | bezier_mouse_x_y(locationX_5, locationY_5, source1.size , panelHeight) 577 | time.sleep(float(random.uniform(.05, .3))) 578 | resting_mouse() 579 | 580 | #time.sleep(10) 581 | #print("Starting WebdriverWait for exception 11") 582 | 583 | #Checking for image icon of an envelope that appears when account is created successfully // Checking for svg of an X when Network Error appears // Search for "Slide to complete the puzzle" if the puzzle is not solved sucesssfully 584 | #try: 585 | # WebDriverWait(driver, 30).until(EC.visibility_of_element_located((By.XPATH, "/html/body/div[2]/div/div/div/div/img")) or EC.visibility_of_element_located((By.XPATH, "/div/div/svg")) or EC.visibility_of_element_located((By.XPATH, "/html/body/div[4]/div/div[2]/div[2]/div[1]"))) 586 | #except Exception as ee: 587 | # print(ee) 588 | # print("Exception occured: 11") 589 | # break 590 | 591 | accountCreated = 0 592 | accountCreatedCheckIterations = 0 593 | 594 | while accountCreated == 0: 595 | time.sleep(0.5) 596 | if "We've sent you an activation email" in driver.page_source: 597 | 598 | print("Captcha Solved!") 599 | captcha_solved = 1 600 | print("Account created!") 601 | resting_mouse() 602 | 603 | #Fetch emails from Yopmail 604 | 605 | ''' 606 | try: 607 | driver.set_page_load_timeout(60) 608 | url='https://yopmail.com/en/' 609 | driver.get(url) 610 | except Exception: 611 | print('Page Loading forever, pressing ESC to stop loading') 612 | pyautogui.press('esc') 613 | 614 | print("Activating Account... ") 615 | 616 | #Close Allow Cookie popup if exists 617 | 618 | if driver.find_elements(By.XPATH, '//*[@id="accept"]'): 619 | allowCookies = driver.find_element(By.XPATH,'//*[@id="accept"]') 620 | bezier_mouse(allowCookies.location, allowCookies.size , panelHeight) 621 | pyautogui.click() 622 | 623 | resting_mouse() 624 | 625 | 626 | #Add Email that I want to check 627 | 628 | try: 629 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="login"]'))) 630 | except Exception: 631 | print("Exception occured: 5") 632 | break 633 | 634 | emailinput = driver.find_element(By.XPATH,'//*[@id="login"]') 635 | bezier_mouse(emailinput.location, emailinput.size , panelHeight) 636 | pyautogui.click() 637 | slow_type(driver.find_element(By.XPATH,'//*[@id="login"]'),email) 638 | 639 | 640 | #Check Emails 641 | 642 | try: 643 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="refreshbut"]/button/i'))) 644 | except Exception: 645 | print("Exception occured: 6") 646 | break 647 | 648 | emailButton = driver.find_element(By.XPATH,'//*[@id="refreshbut"]/button/i') 649 | bezier_mouse(emailButton.location, emailButton.size , panelHeight) 650 | pyautogui.click() 651 | resting_mouse() 652 | time.sleep(5) 653 | 654 | 655 | #Open Account Activation Link 656 | 657 | try: 658 | WebDriverWait(driver, 30).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, '//*[@id="ifmail"]'))) 659 | except Exception: 660 | print("Exception occured: 7") 661 | break 662 | 663 | verificationLink = driver.find_element(By.XPATH,'//*[@id="mail"]/div/div/table/tbody/tr/td/table[2]/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[7]/td/span/a') 664 | 665 | try: 666 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="mail"]/div/div/table/tbody/tr/td/table[2]/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[7]/td/span/a'))) 667 | except Exception: 668 | print("Exception occured: 8") 669 | break 670 | 671 | confirmation_link = driver.find_element(By.XPATH,'//*[@id="mail"]/div/div/table/tbody/tr/td/table[2]/tbody/tr/td/table/tbody/tr/td/table/tbody/tr/td/table/tbody/tr[7]/td/span/a').get_attribute('href') 672 | driver.switch_to.default_content() 673 | print(confirmation_link) 674 | ''' 675 | 676 | 677 | #Get link from Email to Activate Account 678 | 679 | headers = CaseInsensitiveDict() 680 | 681 | 682 | headers["Accept"] = 'application/vnd.mailcare.v1+json' 683 | headers["Authorization"] = 'Basic c291b2RhdmlkZUBnbWFpbC5jb206MTIzNDVzb3VvZGF2aWRlIQ==' 684 | 685 | url = 'http://nomadside.com/api/emails?page=&limit=1&inbox='+str(email)+'&sender=&subject=&since=&until=&search=&unread=&favorite=' 686 | 687 | resp = requests.get(url, headers=headers) 688 | 689 | response_body = resp.content 690 | response_body = json.loads(response_body) 691 | 692 | 693 | last_email_id = (response_body['data'][0]['id']) 694 | 695 | 696 | headers = CaseInsensitiveDict() 697 | 698 | 699 | headers["Accept"] = 'text/html' 700 | headers["Authorization"] = 'Basic c291b2RhdmlkZUBnbWFpbC5jb206MTIzNDVzb3VvZGF2aWRlIQ==' 701 | 702 | url = 'https://nomadside.com/api/emails/'+str(last_email_id) 703 | 704 | resp = requests.get(url, headers=headers) 705 | 706 | response_body = str(resp.content) 707 | confirmation_link = find_between( response_body, 'clicktracking="off" href="', '" class="es-button"' ) 708 | confirmation_link = confirmation_link.replace('amp;', '') 709 | 710 | print(confirmation_link) 711 | 712 | try: 713 | driver.set_page_load_timeout(60) 714 | url=confirmation_link 715 | driver.get(url) 716 | except Exception: 717 | print('Page Loading forever, pressing ESC to stop loading') 718 | pyautogui.press('esc') 719 | 720 | print("Account Activated!") 721 | print("Searching for session token...") 722 | 723 | sessionfetched = 0 724 | GetTokenRetryAmount = 0 725 | while sessionfetched == 0: 726 | for request in driver.requests: 727 | 728 | findThis = "Bearer" 729 | 730 | if findThis in str(request.headers): 731 | print("Session token found!") 732 | sessionToken = str(request.headers) 733 | sessionfetched = 1 734 | 735 | # Fetch just the authorization token (session) from the whole request header 736 | sub1 = "Bearer" 737 | sub2 = "content-type:" 738 | 739 | idx1 = sessionToken.index(sub1) 740 | idx2 = sessionToken.index(sub2) 741 | 742 | sessionToken = sessionToken[idx1 + len(sub1) + 1: idx2] 743 | 744 | sessionLocalStorage = driver.execute_script("return localStorage.getItem('u');") 745 | print(sessionLocalStorage+"\n") 746 | sessionLocalStorage = str(sessionLocalStorage) 747 | 748 | # Save Session to TXT files 749 | with open('sessions_full.txt', 'a') as file: 750 | dateNow = str(datetime.now()) 751 | print(str(ip)+" "+dateNow+" "+"Email: "+email+" "+password+" "+sessionToken) 752 | file.write(str(ip)+" "+dateNow+" "+"Email: "+email+" "+password+" "+sessionToken) 753 | 754 | with open('sessions.txt', 'a') as file: 755 | file.write(sessionToken) 756 | 757 | with open('sessions_selenium.txt', 'a') as file: 758 | file.write(sessionLocalStorage+'\n') 759 | 760 | # Save Session to MYSQL Database 761 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc") 762 | mycursor = mydb.cursor() 763 | 764 | sql = "INSERT INTO sessions (ip, email, password, session, session_selenium, date_created) VALUES (%s, %s, %s, %s, %s, %s)" 765 | val = (str(ip) , email, password, sessionToken, sessionLocalStorage, dateNow) 766 | mycursor.execute(sql, val) 767 | 768 | mydb.commit() 769 | print("Session saved into Database with ID: ", mycursor.lastrowid) 770 | 771 | print("############### ACCOUNT INFO AND COOKIE SAVED! ###############") 772 | 773 | 774 | 775 | # Rotate proxy after account is created 776 | url = "https://dashboard.iproyal.com/4g-mobile-proxies/rotate-ip/lithuanian/begVEeOcP" 777 | 778 | payload={} 779 | headers = { 780 | 'Content-Type': 'application/json' 781 | } 782 | 783 | response = requests.request("GET", url, headers=headers, data=payload) 784 | restart_script = 1 785 | print(response.text) 786 | print("Restarting and rotating proxy!") 787 | 788 | accountCreated = 1 789 | break 790 | 791 | if sessionfetched == 0: 792 | if GetTokenRetryAmount > 1: 793 | print("FAILED to get Session token, SKIPPING") 794 | accountCreated = 1 795 | break 796 | 797 | 798 | GetTokenRetryAmount+=1 799 | print("Session token not found, retrying.. x"+str(GetTokenRetryAmount)) 800 | 801 | 802 | 803 | try: 804 | driver.set_page_load_timeout(60) 805 | url=confirmation_link 806 | driver.get(url) 807 | except Exception: 808 | print('Page Loading forever, pressing ESC to stop loading') 809 | pyautogui.press('esc') 810 | 811 | 812 | elif "Slide to complete the puzzle" in driver.page_source: 813 | print("FAILED to solve Captcha!") 814 | pyautogui.moveTo(random.randint(1600,1750), random.randint(400,850)) 815 | pyautogui.click() 816 | break 817 | else: 818 | accountCreatedCheckIterations+=1 819 | if accountCreatedCheckIterations == 20: 820 | print("ERROR") 821 | network_error = 1 822 | break 823 | driver.quit() 824 | 825 | 826 | currentRunNumber = 0 827 | quantityOfAccounts = 50000 828 | 829 | #range is the number of exceptions it handles until it just doesnt try to run the main script again 830 | for i in range(1, 5000): 831 | try: 832 | main(currentRunNumber,quantityOfAccounts) 833 | except Exception as e: 834 | print (e) 835 | print('#####################################################') 836 | print('UNKNOWN EXCEPTION OCCURED, Restarting main function!') 837 | print('#####################################################') 838 | continue 839 | else: 840 | break 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | -------------------------------------------------------------------------------- /start.bat: -------------------------------------------------------------------------------- 1 | py signup.py -------------------------------------------------------------------------------- /updateProfile.bat: -------------------------------------------------------------------------------- 1 | py updateProfile.py --displayName "ColnMarketCap ✔" --username ColnMarketCap --avatar 14 --quantity 1000 2 | pause -------------------------------------------------------------------------------- /updateProfile.py: -------------------------------------------------------------------------------- 1 | import time 2 | import cv2 3 | import random 4 | import numpy as np 5 | import pyautogui 6 | import bezier 7 | import requests 8 | import os 9 | import re 10 | import sys 11 | import json 12 | import names 13 | import pickle 14 | from datetime import datetime 15 | from requests import get 16 | from fake_useragent import UserAgent 17 | from requests.structures import CaseInsensitiveDict 18 | from random import randrange 19 | import mysql.connector 20 | 21 | from seleniumwire.undetected_chromedriver.v2 import Chrome 22 | 23 | from selenium.webdriver.chrome.options import Options 24 | 25 | from selenium.webdriver.chrome.service import Service 26 | from selenium.webdriver.common.by import By 27 | from selenium.webdriver import ActionChains 28 | from selenium.webdriver.common.action_chains import ActionChains 29 | from selenium.webdriver.common.keys import Keys 30 | from selenium.webdriver.support import expected_conditions as EC 31 | from selenium.common.exceptions import NoSuchElementException 32 | from selenium.webdriver.support.ui import WebDriverWait 33 | 34 | import argparse 35 | 36 | 37 | 38 | # Disable pyautogui pauses 39 | pyautogui.MINIMUM_DURATION = 0 40 | pyautogui.MINIMUM_SLEEP = 0 41 | pyautogui.PAUSE = 0 42 | 43 | 44 | 45 | 46 | 47 | # Create the parser 48 | parser = argparse.ArgumentParser() 49 | 50 | # Add an argument 51 | parser.add_argument('--displayName', type=str, required=True) 52 | parser.add_argument('--username', type=str, required=True) 53 | parser.add_argument('--avatar', type=str, required=True) 54 | parser.add_argument('--quantity', type=str, required=True) 55 | 56 | # Parse the argument 57 | args = parser.parse_args() 58 | displayName = args.displayName # DisplayName to change to 59 | username = args.username # Username to change to ( can only be done every 7 days ) 60 | avatar = args.avatar # Avatar position example: 5 | it will change to the avatar on position 5 61 | quantity = args.quantity # Avatar position example: 5 | it will change to the avatar on position 5 62 | 63 | 64 | if len(username)>13: 65 | print("Username too long, pick another") 66 | quit() 67 | 68 | def find_between( s, first, last ): 69 | try: 70 | start = s.index( first ) + len( first ) 71 | end = s.index( last, start ) 72 | return s[start:end] 73 | except ValueError: 74 | return "" 75 | 76 | 77 | def updateProfile(session,displayName,username,avatar,amountOftimes): 78 | if __name__ == "__main__": 79 | print("Started") 80 | #print(session) 81 | ua = UserAgent() 82 | user_agent = ua.chrome 83 | 84 | 85 | # SETUP PROXY WITH AUTHENTICATION 86 | seleniumwire_options = { 87 | } 88 | 89 | 90 | options = Options() 91 | options.add_argument('--window-size=1980,1980') 92 | options.add_argument('--headless') 93 | 94 | # FOR PROXY WITH AUTHENTICATION 95 | driver = Chrome(seleniumwire_options=seleniumwire_options, options=options) 96 | 97 | driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") 98 | 99 | actions = ActionChains(driver) 100 | 101 | #Enter Coin Page 102 | 103 | try: 104 | driver.set_page_load_timeout(60) 105 | url='https://coinmarketcap.com/' 106 | driver.get(url) 107 | except Exception: 108 | print("Exception occured: 1") 109 | print('Page Loading forever, pressing ESC to stop loading') 110 | actions.send_keys(Keys.ESC) 111 | actions.perform() 112 | 113 | print("Entered coinmarketcap") 114 | 115 | # Add user login session 116 | driver.execute_script("window.localStorage.setItem('{}',{})".format("u", json.dumps(session))) 117 | driver.refresh() 118 | 119 | user_email = session 120 | user_email = find_between( user_email, 'email":"', '","username' ) 121 | print("Logged in to: "+str(user_email)) 122 | 123 | 124 | 125 | #Enter Profile Page 126 | try: 127 | driver.set_page_load_timeout(60) 128 | url='https://coinmarketcap.com/settings' 129 | driver.get(url) 130 | except Exception: 131 | print("Exception occured: 2") 132 | print('Page Loading forever, pressing ESC to stop loading') 133 | actions.send_keys(Keys.ESC) 134 | actions.perform() 135 | 136 | #Change Display Name 137 | try: 138 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[2]/input'))) 139 | except Exception: 140 | print("Exception occured: 2") 141 | 142 | displayNameInput = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[2]/input') 143 | displayNameInput.click() 144 | displayNameInput.send_keys(Keys.CONTROL,"a") 145 | displayNameInput.send_keys(Keys.DELETE) 146 | displayNameInput.send_keys(displayName) 147 | 148 | #Change Avatar 149 | try: 150 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[1]/div[2]/button'))) 151 | except Exception: 152 | print("Exception occured: 3") 153 | 154 | editAvatarButton = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[1]/div[2]/button') 155 | editAvatarButton.click() 156 | time.sleep(2) # CODE SOMETHING TO WAIT FOR SUBMIT BUTTON TO GO BACK TO BLUE AFTER 3 SECONDS WHICH CONFIRMS FORM WAS SUBMITED 157 | 158 | AvatarImage = driver.find_element(By.XPATH,'//*[@id="avatars-lists"]/div['+str(avatar)+']') 159 | AvatarImage.click() 160 | 161 | #Click on Select Avatar Button 162 | try: 163 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'/html/body/div[2]/div/div/div/button'))) 164 | except Exception: 165 | print("Exception occured: 4") 166 | 167 | selectAvatar = driver.find_element(By.XPATH,'/html/body/div[2]/div/div/div/button') 168 | selectAvatar.click() 169 | time.sleep(2) 170 | 171 | 172 | #Change Username 173 | try: 174 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[3]/input'))) 175 | except Exception: 176 | print("Exception occured: 5") 177 | 178 | usernameInput = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/div[3]/input') 179 | usernameInput.click() 180 | usernameInput.send_keys(Keys.CONTROL,"a") 181 | usernameInput.send_keys(Keys.DELETE) 182 | username = username+"_"+str(randrange(999999)) 183 | usernameInput.send_keys(username) 184 | 185 | #Click on SAVE Button 186 | try: 187 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/button'))) 188 | except Exception: 189 | print("Exception occured: 6") 190 | 191 | saveButton = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[2]/div/div/div/div[2]/button') 192 | saveButton.click() 193 | time.sleep(4) 194 | 195 | 196 | 197 | #Enter Bitcoin page so the LocalStorage session token data updates 198 | try: 199 | driver.set_page_load_timeout(60) 200 | url='https://coinmarketcap.com/currencies/bitcoin' 201 | driver.get(url) 202 | except Exception: 203 | print("Exception occured: 6") 204 | print('Page Loading forever, pressing ESC to stop loading') 205 | actions.send_keys(Keys.ESC) 206 | actions.perform() 207 | 208 | time.sleep(4) 209 | 210 | # Fetch LocalStorage Session 211 | sessionLocalStorage = driver.execute_script("return localStorage.getItem('u');") 212 | sessionLocalStorage = sessionLocalStorage 213 | 214 | if session == sessionLocalStorage: 215 | print("ERROR, PROFILE DIDNT UPDATE! SKIPPING") 216 | else: 217 | 218 | # Update old LocalStorage Session to the new one 219 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 220 | mycursor = mydb.cursor() 221 | dateNow = str(datetime.now()) 222 | 223 | sql = 'UPDATE sessions SET session_selenium = %s, updated = %s, updated_at = %s, updated_displayName = %s, updated_username = %s, updated_avatar = %s WHERE email = %s' 224 | values = [sessionLocalStorage,int(1),str(dateNow),str(displayName),str(username),str(avatar),str(user_email)] 225 | mycursor.execute(sql, values) 226 | 227 | if mycursor.rowcount == 1: 228 | print("PROFILE UPDATED!") 229 | else: 230 | print("Debug: "+str(mycursor.rowcount)) 231 | print("Debug: "+str(user_email)) 232 | print("Debug: "+str(mycursor.execute)) 233 | 234 | 235 | print("################################") 236 | 237 | time.sleep(5) 238 | driver.quit() 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | amountOftimes = 0 247 | 248 | # Select sessions from Database 249 | mydb = mysql.connector.connect( host="sql327.main-hosting.eu", user="u830852358_cmc", password="Davide74", database="u830852358_cmc", autocommit=True) 250 | mycursor = mydb.cursor() 251 | 252 | # Only select sessions that werent updated before, change this to select sessions updated more than 7 days ago as well later 253 | sql = 'SELECT session_selenium FROM sessions WHERE updated = 0 LIMIT '+str(quantity) 254 | mycursor.execute(sql) 255 | sessions = mycursor.fetchall() 256 | 257 | # Select sessions from TXT file 258 | #with open("sessions_selenium.txt") as file: 259 | # sessions = file.read().splitlines() 260 | 261 | #range is the number of exceptions it handles until it just doesnt try to run the main script again 262 | 263 | 264 | for session in sessions: 265 | for i in range(1, 5000): 266 | try: 267 | updateProfile(session[0],displayName,username,avatar,amountOftimes) 268 | except Exception as e: 269 | print (e) 270 | print('#####################################################') 271 | print('UNKNOWN EXCEPTION OCCURED, Restarting main function!') 272 | print('#####################################################') 273 | continue 274 | else: 275 | break 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | -------------------------------------------------------------------------------- /vote_coin2.py: -------------------------------------------------------------------------------- 1 | import time 2 | import cv2 3 | import random 4 | import numpy as np 5 | import pyautogui 6 | import bezier 7 | import requests 8 | import os 9 | import re 10 | import sys 11 | import json 12 | import names 13 | import pickle 14 | from datetime import datetime 15 | from requests import get 16 | from fake_useragent import UserAgent 17 | from requests.structures import CaseInsensitiveDict 18 | 19 | from seleniumwire.undetected_chromedriver.v2 import Chrome 20 | 21 | from selenium.webdriver.chrome.options import Options 22 | 23 | from selenium.webdriver.chrome.service import Service 24 | from selenium.webdriver.common.by import By 25 | from selenium.webdriver import ActionChains 26 | from selenium.webdriver.common.action_chains import ActionChains 27 | from selenium.webdriver.common.keys import Keys 28 | from selenium.webdriver.support import expected_conditions as EC 29 | from selenium.common.exceptions import NoSuchElementException 30 | from selenium.webdriver.support.ui import WebDriverWait 31 | 32 | import argparse 33 | 34 | 35 | 36 | # Disable pyautogui pauses 37 | pyautogui.MINIMUM_DURATION = 0 38 | pyautogui.MINIMUM_SLEEP = 0 39 | pyautogui.PAUSE = 0 40 | 41 | 42 | 43 | 44 | 45 | # Create the parser 46 | parser = argparse.ArgumentParser() 47 | 48 | # Add an argument 49 | parser.add_argument('--coinurl', type=str, required=True) 50 | 51 | # Parse the argument 52 | args = parser.parse_args() 53 | coinurl = args.coinurl 54 | 55 | 56 | 57 | 58 | with open("sessions_selenium.txt") as file: 59 | sessions = file.read().splitlines() 60 | 61 | 62 | def watchlist(session,coinurl): 63 | if __name__ == "__main__": 64 | 65 | ua = UserAgent() 66 | user_agent = ua.chrome 67 | 68 | 69 | # SETUP PROXY WITH AUTHENTICATION 70 | seleniumwire_options = { 71 | 'proxy': { 72 | 'http': 'http://oxy123asdx:GbaTTyshca@4g.iproyal.com:4001', 73 | 'https': 'https://oxy123asdx:GbaTTyshca@4g.iproyal.com:4001', 74 | 'no_proxy': 'localhost,127.0.0.1' 75 | } 76 | } 77 | 78 | 79 | options = Options() 80 | #PROXY = "195.154.255.118:15001" 81 | #options.add_argument('--proxy-server=%s' % PROXY) 82 | options.add_argument('--window-size=1980,1980') 83 | options.add_argument('--headless') 84 | 85 | # FOR PROXY WITH AUTHENTICATION 86 | driver = Chrome(seleniumwire_options=seleniumwire_options, options=options) 87 | 88 | #driver = Chrome(options=options) 89 | driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") 90 | 91 | 92 | 93 | #Enter Coin Page 94 | 95 | try: 96 | driver.set_page_load_timeout(60) 97 | url='https://coinmarketcap.com/' 98 | driver.get(url) 99 | except Exception: 100 | print("Exception occured: 1") 101 | print('Page Loading forever, pressing ESC to stop loading') 102 | pyautogui.press('esc') 103 | 104 | print("Entered coinmarketcap") 105 | driver.execute_script("window.localStorage.setItem('{}',{})".format("u", json.dumps(session))) 106 | driver.refresh() 107 | print("Logged in") 108 | 109 | inputSearch1 = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[1]/div[1]/div/div[2]/div[4]/div/div[1]') 110 | inputSearch1.click() 111 | time.sleep(5) 112 | 113 | inputSearch = driver.find_element(By.XPATH,'//*[@class="tippy-content"]/div/div/div[1]/div[1]/input') 114 | inputSearch.click() 115 | inputSearch.send_keys(coinurl) 116 | inputSearch.send_keys(Keys.ENTER) 117 | print("Searched for Coin") 118 | 119 | startWatchlist = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/span/button/span') 120 | startWatchlist.click() 121 | print("Added coin to Watchlist") 122 | 123 | 124 | 125 | #botaoWatchList = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/span/button/span') 126 | #botaoWatchList.click() 127 | time.sleep(5000) 128 | 129 | 130 | amountOftimes = 0 131 | for session in sessions: 132 | amountOftimes +=1 133 | watchlist(session,coinurl) -------------------------------------------------------------------------------- /watchlist2.py: -------------------------------------------------------------------------------- 1 | import time 2 | import cv2 3 | import random 4 | import numpy as np 5 | import pyautogui 6 | import bezier 7 | import requests 8 | import os 9 | import re 10 | import sys 11 | import json 12 | import names 13 | import pickle 14 | from datetime import datetime 15 | from requests import get 16 | from fake_useragent import UserAgent 17 | from requests.structures import CaseInsensitiveDict 18 | 19 | from seleniumwire.undetected_chromedriver.v2 import Chrome 20 | 21 | from selenium.webdriver.chrome.options import Options 22 | 23 | from selenium.webdriver.chrome.service import Service 24 | from selenium.webdriver.common.by import By 25 | from selenium.webdriver import ActionChains 26 | from selenium.webdriver.common.action_chains import ActionChains 27 | from selenium.webdriver.common.keys import Keys 28 | from selenium.webdriver.support import expected_conditions as EC 29 | from selenium.common.exceptions import NoSuchElementException 30 | from selenium.webdriver.support.ui import WebDriverWait 31 | 32 | import argparse 33 | 34 | 35 | 36 | # Disable pyautogui pauses 37 | pyautogui.MINIMUM_DURATION = 0 38 | pyautogui.MINIMUM_SLEEP = 0 39 | pyautogui.PAUSE = 0 40 | 41 | 42 | 43 | 44 | 45 | # Create the parser 46 | parser = argparse.ArgumentParser() 47 | 48 | # Add an argument 49 | parser.add_argument('--coinurl', type=str, required=True) 50 | 51 | # Parse the argument 52 | args = parser.parse_args() 53 | coinurl = args.coinurl 54 | 55 | def find_between( s, first, last ): 56 | try: 57 | start = s.index( first ) + len( first ) 58 | end = s.index( last, start ) 59 | return s[start:end] 60 | except ValueError: 61 | return "" 62 | 63 | 64 | def watchlist(session,coinurl,amountOftimes): 65 | if __name__ == "__main__": 66 | print("Started") 67 | ua = UserAgent() 68 | user_agent = ua.chrome 69 | 70 | 71 | # SETUP PROXY WITH AUTHENTICATION 72 | seleniumwire_options = { 73 | } 74 | 75 | 76 | options = Options() 77 | #PROXY = "195.154.255.118:15001" 78 | #options.add_argument('--proxy-server=%s' % PROXY) 79 | options.add_argument('--window-size=1980,1980') 80 | #options.add_argument('--headless') 81 | 82 | # FOR PROXY WITH AUTHENTICATION 83 | driver = Chrome(seleniumwire_options=seleniumwire_options, options=options) 84 | 85 | #driver = Chrome(options=options) 86 | driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") 87 | 88 | 89 | #Enter Coin Page 90 | 91 | try: 92 | driver.set_page_load_timeout(60) 93 | url='https://coinmarketcap.com/' 94 | driver.get(url) 95 | except Exception: 96 | print("Exception occured: 1") 97 | print('Page Loading forever, pressing ESC to stop loading') 98 | pyautogui.press('esc') 99 | 100 | print("Entered coinmarketcap") 101 | 102 | # Add user login session 103 | driver.execute_script("window.localStorage.setItem('{}',{})".format("u", json.dumps(session))) 104 | driver.refresh() 105 | 106 | user_email = session 107 | user_email = find_between( user_email, 'email":"', '","username' ) 108 | print("Logged in to: "+str(user_email)) 109 | 110 | 111 | 112 | # Click on the Searchbox 113 | 114 | try: 115 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="__next"]/div/div[1]/div[1]/div[1]/div/div[2]/div[4]/div/div[1]'))) 116 | except Exception: 117 | print("Exception occured: 2") 118 | 119 | inputSearch1 = driver.find_element(By.XPATH,'//*[@id="__next"]/div/div[1]/div[1]/div[1]/div/div[2]/div[4]/div/div[1]') 120 | inputSearch1.click() 121 | 122 | # Click on the Second Searchbox that extends 123 | 124 | try: 125 | WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH,'//*[@class="tippy-content"]/div/div/div[1]/div[1]/input'))) 126 | except Exception: 127 | print("Exception occured: 3") 128 | 129 | inputSearch2 = driver.find_element(By.XPATH,'//*[@class="tippy-content"]/div/div/div/div/input') 130 | inputSearch2.click() 131 | time.sleep(5) 132 | # Insert name of the coin to search for 133 | inputSearch2.send_keys(coinurl) 134 | inputSearch2.send_keys(Keys.ENTER) 135 | 136 | 137 | 138 | print("Searched for: "+str(coinurl)) 139 | 140 | #Wait for page to fully load 141 | try: 142 | WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/h2'))) 143 | print("Coin page Loaded") 144 | except Exception: 145 | print("Exception occured: 6") 146 | 147 | time.sleep(3) 148 | 149 | #Check if coin already on watchlist 150 | if len(driver.find_elements(By.XPATH,'//*[@class="icon-Star-Filled"]'))>0: 151 | print("SKIPPED. Coin already on watchlist") 152 | elif len(driver.find_elements(By.XPATH,'//*[@class="icon-Star"]'))>0: 153 | addWatchlist = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/span/button/span') 154 | addWatchlist.click() 155 | amountOftimes +=1 156 | print("Coin added to watchlist. x"+str(amountOftimes)) 157 | else: 158 | print("UNKNOWN ERROR") 159 | 160 | voteID = driver.execute_script("return localStorage.getItem('voteID');") 161 | print("voteID: "+str(voteID)) 162 | 163 | #botaoWatchList = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[1]/div[2]/div/div[1]/div[1]/span/button/span') 164 | #botaoWatchList.click() 165 | print("####################################") 166 | downVote = driver.find_element(By.XPATH,'//*[@id="__next"]/div[1]/div[1]/div[2]/div/div[3]/div/div[1]/div[2]/div[4]/div/div[2]/button[2]') 167 | downVote.click() 168 | 169 | time.sleep(1110) 170 | driver.quit() 171 | 172 | 173 | amountOftimes = 0 174 | 175 | with open("sessions_selenium.txt") as file: 176 | sessions = file.read().splitlines() 177 | 178 | #range is the number of exceptions it handles until it just doesnt try to run the main script again 179 | for session in sessions: 180 | for i in range(1, 5000): 181 | try: 182 | watchlist(session,coinurl,amountOftimes) 183 | except Exception as e: 184 | print (e) 185 | print('#####################################################') 186 | print('UNKNOWN EXCEPTION OCCURED, Restarting main function!') 187 | print('#####################################################') 188 | continue 189 | else: 190 | break 191 | 192 | 193 | # RESOLVER O AMOUNTOFTIMES SO DAR X1 E VOLTAR A 0 194 | # ADICIONAR MULTITHREADING 195 | 196 | 197 | 198 | 199 | 200 | --------------------------------------------------------------------------------