├── .gitignore ├── README.md ├── coin_details.py ├── data_processing.py ├── examples ├── coingecko_api_test.py ├── example_tweepy.py ├── examples.txt ├── telegram_test.py └── uniswap_tokens.py └── exchanges_bot.py /.gitignore: -------------------------------------------------------------------------------- 1 | keys.py 2 | **/__pycache__ 3 | **/.vscode 4 | **/deploy_erc20 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exchanges New Listings Bot 2 | 3 | Exchanges Listings Bot that sends notifications with a Telegram bot using Twitter API and automatically. 4 | 5 | Use Twitter API to send notifications with Telegram when exchanges tweets about new listings. 6 | 7 | Exchanges that will be monitored: Binance, Coinbase, Huobi, Kraken, KuCoin, Bitfinex, Bithumb, Crypto.com. More exchanges can be added. 8 | 9 | Current exchanges: Binance 10 | 11 | ## Instructions 12 | 13 | Create a keys.py file with your keys 14 | 15 | ```python 16 | # Twitter access keys to read stream and retrieve Binance tweets 17 | 18 | consumer_key="" 19 | consumer_secret="" 20 | access_token="" 21 | access_token_secret="" 22 | 23 | 24 | # Telegram bot id's and keys 25 | 26 | bot_token = '' 27 | bot_chatID = '' 28 | ``` 29 | 30 | Run exchanges_bot.py and wait for notifications. To automatically buy the token on Uniswap or PancakeSwap you can see [this repository](https://github.com/manuelhb14/cake_uni_transaction_bot). A bot for placing orders on Binance futures will be developed in the future. 31 | -------------------------------------------------------------------------------- /coin_details.py: -------------------------------------------------------------------------------- 1 | def coingecko_info(cg,coinlist,coin_symbol,coin_twitter): 2 | coin_num = 0 3 | tweet_num = 0 4 | info = [] 5 | details = [] 6 | twitter_usrname = [] 7 | platform = [] 8 | price = [] 9 | while coin_num < len(coinlist): 10 | if (coinlist[coin_num]['symbol']==coin_symbol): 11 | info.append(coinlist[coin_num]) 12 | coin_num+=1 13 | for i in info: 14 | print(i) 15 | details.append(cg.get_coin_by_id(i['id'])) 16 | for i in details: 17 | twitter_usrname.append(i['links']['twitter_screen_name'].lower()) 18 | platform.append(i['platforms']) 19 | price.append(i['market_data']['current_price']['usd']) 20 | while tweet_num < len(twitter_usrname): 21 | if(twitter_usrname[tweet_num]==coin_twitter): 22 | return (info[tweet_num],platform[tweet_num],price[tweet_num]) 23 | tweet_num+=1 24 | return('Error....') 25 | 26 | def uni_cake_link(platform): 27 | contracts = '' 28 | if ('ethereum' in platform): 29 | contracts += ('https%3A%2F%2Fapp.uniswap.org%2F%23%2Fswap%3FoutputCurrency%3D' + platform['ethereum'] + '\n') 30 | if ('binance-smart-chain' in platform): 31 | contracts += ('https%3A%2F%2Fexchange.pancakeswap.finance%2F%23%2Fswap%3FoutputCurrency%3D' + platform['binance-smart-chain']) 32 | return contracts 33 | -------------------------------------------------------------------------------- /data_processing.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | def basic_info(data): 4 | json_data = json.loads(data) 5 | print(json_data) 6 | tweet = json_data['text'].lower() 7 | date = json_data['created_at'] 8 | user = json_data['user']['id_str'] 9 | text = json_data["text"] 10 | isBinance = ((user=='877807935493033984') or (user=='829941007076687872')) 11 | return (json_data,tweet,date,user,text,isBinance) 12 | 13 | def coin_data(json_data): 14 | coin_symbol = json_data["entities"]['symbols'][0]['text'].lower() 15 | coin_twitter = json_data["entities"]['user_mentions'][0]['screen_name'].lower() 16 | return(coin_symbol,coin_twitter) 17 | 18 | def coin_data_webpage(text): 19 | for i in range(len(text)): 20 | while (text[i]!=')'): 21 | continue 22 | print(text[:i]) -------------------------------------------------------------------------------- /examples/coingecko_api_test.py: -------------------------------------------------------------------------------- 1 | from sys import platform 2 | from pycoingecko import CoinGeckoAPI 3 | from requests import adapters 4 | cg = CoinGeckoAPI() 5 | coinlist = cg.get_coins_list() 6 | 7 | coins_info = [] 8 | coins_details = [] 9 | coins_contract_address = [] 10 | con_num = 0 11 | coin_symbol = 'super' 12 | 13 | while con_num