diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f47a310 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.php] +indent_size = 4 + +[*.md] +indent_size = 4 +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5587ecb --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.DS_Store +Thumbs.db + +.vscode +/vendor +config.php \ No newline at end of file diff --git a/README.md b/README.md index c6a31c5..d0a1a67 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,12 @@ You will need to create an API key on Binance with Futures enabled. Also a twitt ## Dependencies -The script needs those 2 dependencies : +The script is using Composer and needs those two dependencies : - CCXT : https://github.com/ccxt - twitter-api-php from https://github.com/J7mbo/twitter-api-php +All dependencies have to be installed by running `composer install` on the command line. + ## Configuration Set the variables : diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..aceb75e --- /dev/null +++ b/composer.json @@ -0,0 +1,8 @@ +{ + "name": "antoinebaron-io/moon-doge", + "description": "moon-doge is a PHP bot that will buy DogeCoin on Binance when Elon Musk mention DogeCoin on twitter.", + "require": { + "ccxt/ccxt": "^1.49", + "j7mbo/twitter-api-php": "^1.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..bb52b5b --- /dev/null +++ b/composer.lock @@ -0,0 +1,495 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "13870edc9b4b370fd605aff73d7d41cb", + "packages": [ + { + "name": "ccxt/ccxt", + "version": "1.49.60", + "source": { + "type": "git", + "url": "https://github.com/ccxt/ccxt.git", + "reference": "18ec48b74ebcdd74877f2723e057ca3c4596af57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ccxt/ccxt/zipball/18ec48b74ebcdd74877f2723e057ca3c4596af57", + "reference": "18ec48b74ebcdd74877f2723e057ca3c4596af57", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "ext-curl": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "pear/console_table": "1.3.1", + "php": ">=5.4.0", + "symfony/polyfill-mbstring": "^1.7" + }, + "suggest": { + "clue/buzz-react": "Required for asynchronous API calls to exchanges with PHP", + "clue/http-proxy-react": "Required for using a proxy when doing asynchronous API calls to exchanges with PHP", + "react/event-loop": "Required for asynchronous API calls to exchanges with PHP", + "recoil/react": "Required for asynchronous API calls to exchanges with PHP", + "recoil/recoil": "Required for asynchronous API calls to exchanges with PHP" + }, + "type": "library", + "autoload": { + "psr-4": { + "ccxt\\": "php/", + "ccxt_async\\": "php/async/" + }, + "files": [ + "ccxt.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Kroitor", + "email": "igor.kroitor@gmail.com", + "homepage": "https://github.com/kroitor", + "role": "Developer" + }, + { + "name": "Vitaly Gordon", + "email": "rocket.mind@gmail.com", + "homepage": "https://github.com/xpl", + "role": "Developer" + }, + { + "name": "Carlo Revelli", + "email": "carlo.revelli@berkeley.edu", + "homepage": "https://github.com/frosty00", + "role": "Junior Developer" + } + ], + "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for more than 90 bitcoin/altcoin exchanges", + "homepage": "https://github.com/ccxt/ccxt", + "keywords": [ + "1BTCXE", + "1Broker", + "ACX", + "ANX", + "ANXPro", + "BL3P", + "BTC Markets", + "BTC Trade UA", + "BTCC", + "BTCChina", + "BTCExchange", + "BTCTrader", + "BTCTurk", + "BTCX", + "BX.in.th", + "Bit2C", + "BitBay", + "BitBays", + "BitMEX", + "BitMarket", + "Bitcoin.co.id", + "Bleutrade", + "BlinkTrade", + "BtcBox", + "Bter.com", + "C-CEX", + "CEX.IO", + "CHBTC", + "CNY", + "ChileBit", + "CoinMate", + "CoinSpot", + "Coinsecure", + "Crypto Capital", + "DOGE", + "EUR", + "EXMO", + "FYB-SE", + "FYB-SG", + "FoxBit", + "Gatecoin", + "Gemini", + "Huobi", + "HuobiPRO", + "LakeBTC", + "Liqui", + "LiveCoin", + "OKCoin", + "OKCoin.cn", + "OKCoin.com", + "OKEX", + "Paymium", + "Poloniex", + "QUOINE", + "Qryptos", + "QuadrigaCX", + "Southxchange", + "SurBitcoin", + "TheRockTrading", + "Tidex", + "USD", + "UrduBit", + "VBTC", + "Vaultoro", + "VirWoX", + "Wex", + "YoBit", + "Zaif", + "acx.io", + "algorithmic", + "algotrading", + "altcoin", + "altcoins", + "api", + "arbitrage", + "backtest", + "backtesting", + "binance", + "binance.com", + "bit2c.co.il", + "bitcoin", + "bitcoincoid", + "bitfinex", + "bitflyer", + "bitflyer.jp", + "bithumb", + "bithumb.com", + "bitlish", + "bitso", + "bitstamp", + "bittrex", + "bleutrade.com", + "bot", + "btc", + "btc-e", + "btc-trade.com.ua", + "btc-x", + "btcbox.co.jp", + "btce", + "btcexchange.ph", + "btcmarkets", + "btcmarkets.net", + "btctrader.com", + "btcturk.com", + "bter", + "ccex", + "cex", + "chilebit.net", + "coin", + "coincheck", + "coingi", + "coingi.com", + "coinmarketcap", + "coins", + "coinspot.com.au", + "crypto", + "crypto currency", + "crypto market", + "cryptocapital.co", + "cryptocurrency", + "currencies", + "currency", + "darkcoin", + "dash", + "digital currency", + "dogecoin", + "dsx", + "dsx.uk", + "e-commerce", + "etc", + "eth", + "ether", + "ethereum", + "exchange", + "exchanges", + "flowBTC", + "flowbtc.com", + "foxbit.exchange", + "framework", + "gdax", + "hitbtc", + "huobi.pro", + "independent reserve", + "independentreserve.com", + "invest", + "investing", + "investor", + "itBit", + "jubi.com", + "kraken", + "lakebtc.com", + "library", + "light", + "liqui.io", + "litecoin", + "ltc", + "luno", + "market", + "market data", + "markets", + "mercado", + "mercadobitcoin", + "mercadobitcoin.br", + "merchandise", + "merchant", + "minimal", + "mixcoins", + "mixcoins.com", + "nova", + "novaexchange", + "novaexchange.com", + "okex.com", + "order", + "order book", + "orderbook", + "price", + "price data", + "pricefeed", + "private", + "public", + "ripple", + "strategy", + "surbitcoin.com", + "tidex.com", + "toolkit", + "trade", + "trader", + "trading", + "urdubit.com", + "vbtc.exchange", + "vbtc.vn", + "volume", + "wex.nz", + "xBTCe", + "xbt", + "xbtce.com", + "xrp", + "yobit.net", + "yunbi", + "zec", + "zerocoin" + ], + "support": { + "issues": "https://github.com/ccxt/ccxt/issues", + "source": "https://github.com/ccxt/ccxt/tree/1.49.60" + }, + "funding": [ + { + "url": "https://opencollective.com/ccxt", + "type": "open_collective" + } + ], + "time": "2021-05-07T06:36:59+00:00" + }, + { + "name": "j7mbo/twitter-api-php", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/J7mbo/twitter-api-php.git", + "reference": "443d22c53d621b3cc6b7e0c56daa60c5ada033f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/J7mbo/twitter-api-php/zipball/443d22c53d621b3cc6b7e0c56daa60c5ada033f7", + "reference": "443d22c53d621b3cc6b7e0c56daa60c5ada033f7", + "shasum": "" + }, + "require": { + "ext-curl": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.5,>=4.5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "TwitterAPIExchange.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GNU Public License" + ], + "authors": [ + { + "name": "James Mallison", + "homepage": "https://github.com/j7mbo/twitter-api-php" + } + ], + "description": "Simple PHP Wrapper for Twitter API v1.1 calls", + "homepage": "https://github.com/j7mbo/twitter-api-php", + "keywords": [ + "api", + "php", + "twitter" + ], + "support": { + "issues": "https://github.com/J7mbo/twitter-api-php/issues", + "source": "https://github.com/J7mbo/twitter-api-php/tree/master" + }, + "time": "2017-05-08T12:10:56+00:00" + }, + { + "name": "pear/console_table", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/pear/Console_Table.git", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Console_Table/zipball/1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "reference": "1930c11897ca61fd24b95f2f785e99e0f36dcdea", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "suggest": { + "pear/Console_Color2": ">=0.1.2" + }, + "type": "library", + "autoload": { + "classmap": [ + "Table.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jan Schneider", + "homepage": "http://pear.php.net/user/yunosh" + }, + { + "name": "Tal Peer", + "homepage": "http://pear.php.net/user/tal" + }, + { + "name": "Xavier Noguer", + "homepage": "http://pear.php.net/user/xnoguer" + }, + { + "name": "Richard Heyes", + "homepage": "http://pear.php.net/user/richard" + } + ], + "description": "Library that makes it easy to build console style tables.", + "homepage": "http://pear.php.net/package/Console_Table/", + "keywords": [ + "console" + ], + "support": { + "issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Console_Table", + "source": "https://github.com/pear/Console_Table" + }, + "time": "2018-01-25T20:47:17+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/config_example.php b/config_example.php new file mode 100644 index 0000000..3c902e7 --- /dev/null +++ b/config_example.php @@ -0,0 +1,10 @@ +