$this->api_key, 'action' => 'add'], $data); return $this->request($post); } /** Get order status */ public function status($order_id) { return $this->request([ 'key' => $this->api_key, 'action' => 'status', 'order' => $order_id ]); } /** Get orders status */ public function multiStatus($order_ids) { return $this->request([ 'key' => $this->api_key, 'action' => 'status', 'orders' => implode(",", (array)$order_ids) ]); } /** Get services */ public function services() { return $this->request([ 'key' => $this->api_key, 'action' => 'services', ]); } /** Refill order */ public function refill(int $orderId) { return $this->request([ 'key' => $this->api_key, 'action' => 'refill', 'order' => $orderId, ]); } /** Refill orders */ public function multiRefill(array $orderIds) { return $this->request([ 'key' => $this->api_key, 'action' => 'refill', 'orders' => implode(',', $orderIds), ]); } /** Get refill status */ public function refillStatus(int $refillId) { return $this->request([ 'key' => $this->api_key, 'action' => 'refill_status', 'refill' => $refillId, ]); } /** Get refill statuses */ public function multiRefillStatus(array $refillIds) { return $this->request([ 'key' => $this->api_key, 'action' => 'refill_status', 'refills' => implode(',', $refillIds), ]); } /** Cancel orders */ public function cancel(array $orderIds) { return $this->request([ 'key' => $this->api_key, 'action' => 'cancel', 'orders' => implode(',', $orderIds), ]); } /** Get balance */ public function balance() { return $this->request([ 'key' => $this->api_key, 'action' => 'balance', ]); } private function request($post) { $post_fields = []; if (is_array($post)) { foreach ($post as $name => $value) { $post_fields[] = $name . '=' . urlencode($value); } } $ch = curl_init($this->api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); // Changed to 1 for security curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // Changed to 2 for security curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if (is_array($post)) { curl_setopt($ch, CURLOPT_POSTFIELDS, join('&', $post_fields)); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); $result = curl_exec($ch); if (curl_errno($ch) != 0 && empty($result)) { $result = false; } curl_close($ch); return $result; } } // Examples $api = new Api(); $services = $api->services(); # Return all services $balance = $api->balance(); # Return user balance // Add order $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 2, 'interval' => 5]); # Default $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'comments' => "good pic\ngreat photo\n:)\n;)"]); # Custom Comments $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'usernames' => "test, testing", 'hashtags' => "#goodphoto"]); # Mentions with Hashtags $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'usernames' => "test\nexample\nfb"]); # Mentions Custom List $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'username' => "test"]); # Mentions User Followers $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 1000, 'usernames' => "test"]); # Mentions $order = $api->order(['service' => 1, 'link' => 'http://example.com/test']); # Package $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'runs' => 10, 'interval' => 60]); # Drip-feed // Old posts only $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'posts' => 0, 'delay' => 30, 'expiry' => '11/11/2022']); # Subscriptions // Unlimited new posts and 5 old posts $order = $api->order(['service' => 1, 'username' => 'username', 'min' => 100, 'max' => 110, 'old_posts' => 5, 'delay' => 30, 'expiry' => '11/11/2022']); # Subscriptions $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'username' => "test"]); # Comment Likes $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'answer_number' => '7']); # Poll $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'username' => 'username', 'comments' => "good pic\ngreat photo\n:)\n;)"]); # Comment Replies $order = $api->order(['service' => 1, 'link' => 'http://example.com/test', 'quantity' => 100, 'groups' => "group1\ngroup2"]); # Invites from Groups $status = $api->status($order->order); # Return status, charge, remains, start count, currency $statuses = $api->multiStatus([1, 2, 3]); # Return orders status, charge, remains, start count, currency $refill = (array) $api->multiRefill([1, 2]); $refillIds = array_column($refill, 'refill'); if ($refillIds) { $refillStatuses = $api->multiRefillStatus($refillIds); }