{"action":"created","issue":{"url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/193","repository_url":"https://api.github.com/repos/jaggedsoft/php-binance-api","labels_url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/193/comments","events_url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/193/events","html_url":"https://github.com/jaggedsoft/php-binance-api/issues/193","id":362898109,"node_id":"MDU6SXNzdWUzNjI4OTgxMDk=","number":193,"title":"Get miniTicker for all symbols one time!","user":{"login":"phuquoc164","id":21086840,"node_id":"MDQ6VXNlcjIxMDg2ODQw","avatar_url":"https://avatars1.githubusercontent.com/u/21086840?v=4","gravatar_id":"","url":"https://api.github.com/users/phuquoc164","html_url":"https://github.com/phuquoc164","followers_url":"https://api.github.com/users/phuquoc164/followers","following_url":"https://api.github.com/users/phuquoc164/following{/other_user}","gists_url":"https://api.github.com/users/phuquoc164/gists{/gist_id}","starred_url":"https://api.github.com/users/phuquoc164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuquoc164/subscriptions","organizations_url":"https://api.github.com/users/phuquoc164/orgs","repos_url":"https://api.github.com/users/phuquoc164/repos","events_url":"https://api.github.com/users/phuquoc164/events{/privacy}","received_events_url":"https://api.github.com/users/phuquoc164/received_events","type":"User","site_admin":false},"labels":[{"id":712892089,"node_id":"MDU6TGFiZWw3MTI4OTIwODk=","url":"https://api.github.com/repos/jaggedsoft/php-binance-api/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-09-22T23:10:09Z","updated_at":"2018-09-23T08:49:58Z","closed_at":null,"author_association":"NONE","body":"**Description:**\r\nHello @jaggedsoft,\r\n\r\nFirst of all, I want to thank you because you created a great plugin. It's too awesome. But I had a problem when I used it. I'm very happy if you can help me. \r\n\r\nI want to get all informations of all symbols one time when I run the function. I have used your function miniTicker. But it gets all information every second. How can I stop it when I have all informations that I need. Thank you very much and hope you have a good day. \r\n\r\nSinscerely,\r\nDINH Phu Quoc\r\n\r\n\r\nP/S: I insert the function below for that you can read it easily!\r\n**code**\r\n```php\r\npublic function miniTicker(callable $callback)\r\n    {\r\n        $endpoint = '@miniticker';\r\n        $this->subscriptions[$endpoint] = true;\r\n\r\n        // @codeCoverageIgnoreStart\r\n        // phpunit can't cover async function\r\n        \\Ratchet\\Client\\connect($this->stream . '@miniTicker')->then(function ($ws) use ($callback, $endpoint) {\r\n            $ws->on('message', function ($data) use ($ws, $callback, $endpoint) {\r\n                if ($this->subscriptions[$endpoint] === false) {\r\n                    //$this->subscriptions[$endpoint] = null;\r\n                    $ws->close();\r\n                    return; //return $ws->close();\r\n                }\r\n                $json = json_decode($data, true);\r\n                $markets = [];\r\n                foreach ($json as $obj) {\r\n                    $markets[] = [\r\n                        \"symbol\" => $obj['s'],\r\n                        \"close\" => $obj['c'],\r\n                        \"open\" => $obj['o'],\r\n                        \"high\" => $obj['h'],\r\n                        \"low\" => $obj['l'],\r\n                        \"volume\" => $obj['v'],\r\n                        \"quoteVolume\" => $obj['q'],\r\n                        \"eventTime\" => $obj['E'],\r\n                    ];\r\n                }\r\n                call_user_func($callback, $this, $markets);\r\n            });\r\n            $ws->on('close', function ($code = null, $reason = null) {\r\n                // WPCS: XSS OK.\r\n                echo \"miniticker: WebSocket Connection closed! ({$code} - {$reason})\" . PHP_EOL;\r\n            });\r\n        }, function ($e) {\r\n            // WPCS: XSS OK.\r\n            echo \"miniticker: Could not connect: {$e->getMessage()}\" . PHP_EOL;\r\n        });\r\n        // @codeCoverageIgnoreEnd\r\n    }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/comments/423801394","html_url":"https://github.com/jaggedsoft/php-binance-api/issues/193#issuecomment-423801394","issue_url":"https://api.github.com/repos/jaggedsoft/php-binance-api/issues/193","id":423801394,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgwMTM5NA==","user":{"login":"phuquoc164","id":21086840,"node_id":"MDQ6VXNlcjIxMDg2ODQw","avatar_url":"https://avatars1.githubusercontent.com/u/21086840?v=4","gravatar_id":"","url":"https://api.github.com/users/phuquoc164","html_url":"https://github.com/phuquoc164","followers_url":"https://api.github.com/users/phuquoc164/followers","following_url":"https://api.github.com/users/phuquoc164/following{/other_user}","gists_url":"https://api.github.com/users/phuquoc164/gists{/gist_id}","starred_url":"https://api.github.com/users/phuquoc164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phuquoc164/subscriptions","organizations_url":"https://api.github.com/users/phuquoc164/orgs","repos_url":"https://api.github.com/users/phuquoc164/repos","events_url":"https://api.github.com/users/phuquoc164/events{/privacy}","received_events_url":"https://api.github.com/users/phuquoc164/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T08:49:58Z","updated_at":"2018-09-23T08:49:58Z","author_association":"NONE","body":"Thank you very much 👍 . Hope you have a nice day ^^"}}
{"actor":{"display_login":"phuquoc164"}}