curl

Check whether image exists on remote URL

I am generating dynamic URLs of images for book ISBNs. I need a reliable way with PHP to check whether the images actually exist at the remote url. I tried various approaches with different PHP libraries, curl, etc., but none of them works well, some of them are downright slow. Given the fact that I need to generate (and check!) about 60...

"Microsoft DNS Client" vs. getaddrinfo?

Right now, my application is using the c-ares asynchronous DNS resolver library on Windows below cURL, and I have users complaining that it behaves differently from other windows apps. One particular user said that "other applications are using the Microsoft DNS client" and experiences no problems. cURL itself has an asynchronous DNS im...

PHP Curl, retrieving Server IP Address

I'm using PHP CURL to send a request to a server. What do I need to do so the response from server will include that server's IP address? ...

Header only retreival in php via curl

Actually I have two questions. (1) Is there any reduction in processing power or bandwidth used on remote server if I retrieve only headers as opposed to full page retrieval using php and curl? (2) Since I think, and I might be wrong, that answer to first questions is YES, I am trying to get last modified date or If-Modified-Since head...

Weird libcurl error in PHP (Failed to connect to IPHERE: Unknown error 22)

Hi, I was finishing my script and suddenly libcurl stopped working. I thought the server I was connecting to was down or something, but invariably of where I try to connect I get the same sucky error. I even tried rebooting my box, same results. The code snippet where things happen is: public function navigate(array $data) { ...

How do i get wp nonce value for my php libcurl script

I'd like to automate some administrative task for myself on my wpmu install. For example, I'm trying to write php curl script for logging in and adding a new blog. So i'm already logged in via curl and now i want to post form that's in wpmu-blogs.php but it has hidden wp nonce field. How do i get this value into variable? I checked sourc...

Problem with CURL (Multi)

I'm having a problem with curl_multi_*, I want to create a class / function that receives, lets say 1000 URLs, and processes all those URLs 5 at a time, so when a URL finishes downloading it will allocate the now available slot to a new URL that hasn't been processed yet. I've seen some implementations of curl_multi, but none of them al...

Upload file from remote server... (PHP)

I am working with the FaceBook API to upload photos, and the API requires a local file path. As far as I can tell they are handing the request off to CURL like such: upload=@localfilename But my files don't reside locally, so I am trying to figure out if there is a way to make it work with a remote file.... I tried pointing it to a l...

How to extract value from hidden field on form

I have form (on my own blog/cms install which i want to play with a bit) with hidden value which i want to extract. Problem is that there are 2 forms on that page, each with that hidden field with value. On each form field name is the same, only hidden value differs. Something like this: <input type="hidden" id="_hiddenname" name="_hidd...

PHP Curl: read incrementally

I have a PHP script that's supposed to take in a URL and search a database for a cached version of the URL. If it finds it, it prints out the cached version to the user, otherwise it downloads it using cURL and echos it to the user. Currently, the downloading script looks something like this: // create a new cURL resource $ch = curl_i...

Easiest way to grab filesize of remote file in PHP?

I was thinking of doing a head request with cURL, was wondering if this is the way to go? ...

using curl to cronjob a url

Hi , I have an application on php-Codeigniter hosted on MediaTemple and I want to have a cron job runing a controller, the support told me to use CURL I tried using without any succes, example: curl http://mydomain.com/admin/action/get My controller inserts some information to a database, the curl doesn't display error but the ins...

Post to Twitter using Terminal with CURL

I got this far: :~ curl -u username:password -d status="new_status" http://twitter.com/statuses/update.xml Now, how can I alias this with variables so I can easily twit from Terminal? How can I make the alias working through different sessions (when I close Terminal aliases reset). Thanks! ...

Server configured to send 404 to requests from cURL? (PHP)

Hi I am doing some automation for a client and was planning on running some php scripts via cURL in the process. However URLs that work fine in a browser are coming up 404 when hit by cURL. I have seen mention elsewhere that some servers are configured to block cURL in this manner. Is this a setting I could edit in httpd.conf? Doesn...

What is the easiest way to expand HTML escape codes in UNIX?

My cUrl call is returning HTML code like: &quot;Some stuff.&quot; and I'd like to convert it to a UNIX string like: "Some stuff." Is there a way to do this without using search and replace? ...

curl connect timeout not working

Hi, I'm using CURL to connect to multiple xml feeds and process them when the page loads. Unfortunately, every once in awhile a page won't be responsive and my script will stall as well. Here's an example of the code that I'm working with. I set the timeout to 1 but that doesn't appear to be working. I then set the timeout to 0.0001 j...

cURL, frames & letitbit.net: Could you help me please?

I have written a script for Letitbit.net. With help of cURL I can get to the page where after 60 secs is to appear the link to the file I want to download. That page uses frames... If I get to the page via a browser, the sourse code looks just like this: <frameset rows="125,70,*" frameborder="no" border="0" framespacing="0"> <frame src=...

Anyone have a curl command to get IP location?

I'm looking for a URL that I can use with curl that will take on input an IP address and have it return the geographical location of the IP. Anybody know of one? Thanks. ...

How to get the destination URL using cURL?

Hello How to get the destination URL using cURL? when the http status code is 302? <?PHP $url = "http://www.ecs.soton.ac.uk/news/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $html = curl_exec($ch); $status_code = curl_getinfo($ch,...

Creating a couchdb standalone attachment using cURL.

I am currently playing with couchdb and testing out the 'standalone attachments' feature, which is described near the bottom of this page. I am trying to use curl's --data-urlencode feature to send the creation request, which only half works. I can create the attachment and retrieve it, but the Content-Type field is wrong, so the im...