$this->api_key, 'action' => 'add'), $data); $result = $this->connect($post); return $result; } /** * * Order status * */ public function status($order_id) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'status', 'order' => $order_id )); return $result; } /** * * Order multi status * */ public function multi_status($order_ids) { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'status', 'orders' => implode(",", (array)$order_ids) )); return $result; } /** * * All services * */ public function services() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'services', )); return $result; } /** * * Balance * */ public function balance() { $result = $this->connect(array( 'key' => $this->api_key, 'action' => 'balance', )); return $result; } /** * * Connect to panel * */ private function connect($post) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'API (compatible; MSIE 5.01; Windows NT 5.0)'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $result = curl_exec($ch); if (curl_errno($ch) != 0 && empty($result)) { $result = false; } curl_close($ch); return json_decode($result); } } // Examples $api = new Api(); $services = $api->services(); # return all services $balance = $api->balance(); # return user balance // add order $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100)); # Default $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'usernames'=>"test, testing", 'hashtags'=>"#goodphoto")); # Mentions with Hashtags $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'usernames' => "test\nexample\nfb")); # Mentions Custom List $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'hashtag'=>"test")); # Mentions Hashtag $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'username'=>"test")); # Mentions User Followers $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'media'=>"http://example.com/p/Ds2kfEr24Dr")); # Mentions Media Likers $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test')); # Package $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'username' => "test")); # Comment Likes $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)")); # Custom Comments $order = $api->order(array('service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60)); # Drip-feed $status = $api->status(23); # return status, charge, remains, start count, order_id $statuses = $api->multi_status([12, 2, 13]); # return orders status, charge, remains, start count, order_id