curl

How do I make php wait for curl to finish before continuing?

It seems if I do something like $file = fopen($filepath, "w"); $CR = curl_init(); curl_setopt($CR, CURLOPT_URL, $source_path); curl_setopt($CR, CURLOPT_POST, 1); curl_setopt($CR, CURLOPT_FAILONERROR, true); curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($CR, CURLOPT_FILE, $file); $r...

Is it possible to compile libCurl with SSH support using vc8?

I am working on an application, implemented in VC++ 2008 that needs to use sftp through libCurl. In order for this to happen, libCurl needs to be built with ssh support. The problem is that, unlike the mingw makefile, the makefile for vc8 does not have target configurations to build with SSH support. Does anyone know what needs to be ...

PHP app using Twitter API works on some accounts, not others

I have this PHP script that I wrote to automatically follow users that post messages with certain terms. It works 100% of the time on a bunch of test accounts but then does not work on the account I'd like to use it with. I've checked the account's API rate limit and it's well within the boundaries. I've also verified that the userna...

Curl post data and headers only

I want to get the headers only from a curl request curl -I www.google.com All grand. Now I want to do that but to pass in post data too: curl -I -d'test=test' www.google.com But all I get is: Warning: You can only select one HTTP request! Anyone have any idea how to do this or am I doing something stupid? ...

Can't access website via cURL from localhost, but can from hosted server.

I'm writing a script that pulls XML data from wowarmory.com, using PHP 5 and cURL: $url = "http://www.wowarmory.com"; $userAgent = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12'; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_URL,$url); $str ...

Simulating a cookie-enabled browser in PHP

How can I open a web-page and receive its cookies using PHP? The motivation: I am trying to use feed43 to create an RSS feed from the non-RSS-enabled HighLearn website (remote learning website). I found the web-page that contains the feed contents I need to parse, however, it requires to login first. Luckily, logging in can be done via ...

Programmatically log on to forum and then screenscrape

I'd like to login to the Forums part of community-server (e.g. http://tinyurl.com/cs-login) and then download a specific page and perform a regex (to see if there are any posts waiting for moderation). If there is, I'd like to send an email. I'd like to do this from a Linux server. Currently I know how to download a page (using e.g. w...

PHP can't open local file when called externally

I'm using the WorldPay payment gateway on a website I'm working on. It handles all the credit card authorisation, and then calls a PHP file on my server with information about the transaction. It grabs the output from my script and displays it in the WorldPay chrome. I don't know the inner workings, but I imagine that they'd be using so...

PHP cURL - Can't connect to HTTPS site using cURL. Returns 0 length content

I have a site that connects using cURL (latest version) to a secure gateway for payment. The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, fal...

How do I get data from stdin using os.system()

The only reliable method that I a have found for using a script to download text from wikipedia is with cURL. So far the only way I have for doing that is to call os.system(). Even though the output appears properly in the python shell I can't seem to the function it to return anything other than the exit code(0). Alternately somebody co...

How to send a header using a HTTP request through a curl call?

I wish to send a header to my apache server on a linux box. Using a curl call how can I achieve this? ...

Better support for CURL with PHP and Linux

I'm the developer of twittertrend.net, I was wondering if there was a faster way to get headers of a URL, besides doing curl_multi? I process over 250 URLs a minute, and I need a really fast way to do this from a PHP standpoint. Either a bash script could be used and then output the headers or C appliation, anything that could be faster?...

How to upload files to password protected HTTPS site using CURL?

Hi, How can I upload files to a HTTPS site using CURL? The site is also password protected. What's the command line used to upload for that particular site? ...

cURL does not seem to behave correctly here...

Hello! I'm trying the following command on my shell: curl -b usptoCookies -L -d "patentNum=6836866&applicationNum=10007391&maintFeeAction=Get+Bibliographic+Data&maintFeeYear=04" https://ramps.uspto.gov/eram/getMaintFeesInfo.do;jsessionid=0000Nmdd1Q_YsDF90HKmb9EIIgq:11g0uehq7 Pretty straighforward. It is attempting to post a few varia...

How do I debug an Atompub POST sent via cURL to Wordpress on XP + Apache 2.2 + XDebug

I've been using NetBeans as the XDebug interactive debugging client. But seems like it only supports attaching debuggers to scripts that are invoked via Firefox. I want to step through the request parse script when it's invoked via cURL. ...

HTTP file download with Javascript

Is there any way (in Javascript) to download a remote website (i.e. like with Curl), read it into a string variable and further process it? ...

c:import or c:url - specify a timeout value

Hi, I would like to use c:import or c:url to grab the contents of a page (adserver). In addition, I need to specify a timeout, and if the call either times out or the page is not accessible I need some default text to be returned as my value. Is there a jstl tag lib to do this? Or do I need to create my own? ...

PHP/CURL/Other - How resource intensive?

Hi All, I am going to have a daemon that will run on a FreeBSD server, which will exchange small amounts of data with a list of URIs every minute. I am thinking to use the curl_multi functions to run them all at once, or in groups, every minute, using a post. I am open to other ideas though. I will have to do some benchmarking late...

Using cURL and batch line iterations

I have a folder full of files i need to post to a webservice using cURL but i'm not sure on the whole variables and iterations in batch files thing. I know the syntax for curl should be c:\curl\bin\curl -X POST -F File=@[filename] -F "title=[title]" -F "notes=[notes]" "http://xxx/AddScannedImage?debtref=[filename]" but the % symbols...

How do I POST LF with curl command line tool?

I'm trying to POST to the HTTP gateway of an SMS provider (Sybase 365) using CURL from a Linux shell script. I need to pass the following data (note the [ ] and LF characters) [MSISDN] List=+12345678 [MESSAGE] Text=Hello [END] If I submit a file using the -F parameter, CURL removes the LF e.g. curl -F @myfile "http://www.sybase.com/...