curl

How to disable loading images when using CURL?

I want to load a site/url but i do not need the images. How do i exclude images from loading when I use CURL ...

How do I get curl to correctly identify mime type?

I'm using php to post an image along with some other data. Using the sample code from the php doc site (example 2 here: http://php.net/manual/en/function.curl-setopt.php, if I output what gets sent with my script ($_FILE) I see something like this: Array ( [file] => Array ( [name] => temp.gif [type] => application/o...

Curl download of 2.5k+ files too slow.

I have to download 2.5k+ files using curl. I'm using Drupals inbuilt batch api to fire the curl script without it timing out but it's taking well over 10 minutes to grab and save the files. Add this in with the the processing of the actual files. The potential runtime of this script is around 30 minutes. Server performance isn't an issu...

Twitter Oauth via PHP WITHOUT cURL

My server does not support cURL. I want to update my status via php. How to do that without cURL? Again: WITHOUT CURL! ...

When to use cURLs function curl_close?

When is it necessary to close curl connection and release resources consumed by it? Why do I ask this question, well quite simply because I was told, that PHP garbage collector does all of this and sometimes there is no need to close DB connection or call the __destuct method to release resources. Since, that moment I actually started ...

Downloading flv from youtube using curlpp on top of curl - video not playing

Hi, I"m using curlpp on to of curl lib in order to download videos from youtube. I have managed to download the flv but unable to open it using all sorts of video players. I used another youtube video downloader and download the exactly same video with the exactly same quality, I've noticed the requests are the same and also the file ...

Problem when uploading an image to tumblr using php/curl

I've been trying to create a simple php file that will upload a single image to tumblr. An example is listed here, but it just won't work with images. Here is the code: <?php // Authorization info $tumblr_email = '[email protected]'; $tumblr_password = 'secret'; // Data for new record $post_type = 'photo'; //////////////////////TH...

cannot use cookies in cURL PHP

I'm using cURL to parse a website. http://www.hcmiu.edu.vn/bookforsale/showbooks.php It need session to view, if you don't have session then the page redirect to : http://www.hcmiu.edu.vn/bookforsale/perInfo.php I use this code to get session cookie but I don't know why I cannot see any change to file cookies.txt $urltopost...

PHP echoing jpeg image fails, but writing same image to file works great. Why?

I have a function in PHP that calls curl to retrieve an image. When I print that to a file and examine it in the browser, the image looks great. When I use "echo" of the curl results as the return value from my PHP script, the browser shows the broken-image icon (see an example of that icon: http://www.artifacting.com/blog/wp-content/u...

How to call a wsgi app from a php file- using curl, 'post' method. XML data is to be sent as post body and a webhook too has to be supplied.

I have a WSGI app which accepts data sent to it by the 'POST' method. It requires xml data with content-type parameter set to 'application/xml', a valid content-length parameter and a webhook parameter. I have to call this WSGI app by a php file, preferably using a cURL command. How exactly can i do it? Moreover, the webhook file will be...

Nested params with cURL?

I've got an iPhone app requesting an API, and it uses a nested param structure to pass in a username and password to login. In my Rails controller, I'm successfully retrieving this information normally using: username = param[:session][:username] I'd like to test my API from shell, using cURL. But I can't figure out how to provide n...

Extracting HTML Data with Curl / PHP

I have the following code in PHP $ch = curl_init("http://blog.com"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); echo $output; I am trying to i...

Any other good option for fsockopen?

I'm trying to make the code below work with curl or something. I have already taken a look at the curl fsockopen conversion but it doesn't work. The code works except that fsockopen is disabled on my host. Any help will be appreciated. $host = substr($hostport,0,50); $port = substr($hostport,50,10); $issecure = substr($hostport,60,1); ...

multiple curl call to the same url

I want to build hits engine that simulate users hits to specific Url, I use curl_exec call to the same url in a loop. How can I improve the performance of this script ? What is the right way to do this ? What i do until now is : $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => tru...

PHP function curl_exec() slows down my script

I use the following function in CodeIgniter, to get my latest tweet: function tweet($id) { $c = curl_init(); curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/".$id.".xml?count=1"); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); //Benchmark starts here $src = curl_exec($c); ...

php curl CURLOPT_HEADER and dom

I have the following code: curl_setopt($ch, CURLOPT_URL, $host); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $html = curl_exec($ch); preg_match...

Obtain phpBB remote session

I want to crawl some data out of a phpBB forum i'm a member of. But for that, login is required. I can login using cURL, but if I try to crawl the data after logging in using cURL, it still shows that I need to login before viewing that page. Is it possible to login using cURL AND retain that session to do some farther job? Another thin...

PHP - How to check if Curl actually post/send request?

Hey, I basically created a script using Curl and PHP that sends data to the website e.g. host, port and time. Then it submits the data. How would I know if the Curl/PHP actually sent those data to the web pages? $fullcurl = "?host=".$host."&time=".$time."; Any ways to see if they actually sent the data to those URLs on My MYSQL? ...

Facebook Authentication using cURL (php)

I'm trying to use cURL to do facebook authentication and here's what I have: $url = "https://graph.facebook.com/oauth/access_token"; $postString = "?client_id=$client_id&redirect_uri=$redirect_uri&client_secret=$client_secret&code=$code"; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); ...

Unable to exchange Session Data in CURL

I call invoke.php using CURL from curl.php from my localhost. In invoke.php i store some data in session. But when i try to access those session data from curl.php, don't get those session data. How i get those values? Content of curl.php `include_once ('session.php'); $handles = array(); $urlArray = array('http://localhost/invoke.ph...