curl

using curl instead of fopen problems

So, I have been lumped with trying to fix a php script we have on our remote access page. Originally it would use fopen to if a site was available. If it was the user would be directed to that site, if it was down the next url would be tested and the user redirected there if it was successful etc etc. Our new shared hosting site does ...

PHP HTTP Post to REST Service not updating database

Hi guys, I have this curl request below, which was successfully troubleshooted in another post. Right now, my PHP seems to work through this code without any errors, moves onto the next part of the IF statement and sends the confirmation email. It just doesn't update the database as it should from the web service. I will have to email ...

reading large file from remote server using php script

I am trying to read large files lets say illustrator file or photoshop file using cron job in my system. Files size varies from 20 mb - 300 mb I have been using some function but it break in middle while reading. So i wanted to have a fresh opinion. Amount these function file_get_contents readfile curl which is most effective in te...

POST to sample URL for PayPal without "form"

I am having some issue posting data to a specific URL when testing payment transactions on the paypal platform. Although much more technically understood, I chose not to use their API and NVP platform because of the requirement to FIRST create a transaction, then come back and have to create a recurring profile (as opposed to all at once...

cURL Cookie and 307 redirect issue

Hi, I currently have a script that loads a page on my clients other server using cURL. Currently, the settings are curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt( $ch, CURLOPT_AUTOREFERER, true ); curl_setopt($ch,CURLOPT_USERAGENT,$useragent); curl_setopt($ch, CURLOPT_HEADER, 0)...

rails curl syntax

Hi All, I can run the following command from my rails app: Hash.from_xml(%x{curl -d "admin=true" http://localhost:8888} ) rescue nil now I want to replace the "admin=true" by a variable If I have x = "admin=true" how can I then write the above command? Thanks a lot ...

Help me converting this CURL to a Post method in Rails

I am trying to post an XML to an API which returns me an XML. I successfully did that by executing a simple CURL command curl "http://my.server.com/api/identity/emails_from_ids" --proxy dvaic.snv.fex:80 -d "<users><id>3434</id></users>" -X POST -H 'Content-Type: application/xml' -u admin:admin The above command executes successfull...

Login to google bookmarks service using cmd-line curl

Since google bookmarks don't have API exposed, I have to do it manually. I tried first regularly, with using clientAuth and passing token in subsequent request but it doesn't work (the same code works for other exposed services, like picasa or contacts). I used Temper Data plugin for Firefox to record posted data in order to replay it...

How to use Curl from command line to post GET method with cookies

`I have this requests that i have to send with windows xp GET https://website.com/index.aspx?typeoflink=**[HERE-VARIABLE-FROM-FILE]**&amp;min=1 HTTP/1.1 Accept: */* Referer: https://website.com/index.aspx?chknumbertypeoflink&amp;min=1 Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Wi...

PHP use different curl version than is installed in system.

I am using CentOS distribution and I need to install newer version then 7.15.5. I couldn't upgrade to nower using yum, so I download sources, compile and install without problem. [root ~]# curl -V curl 7.21.1 (i686-pc-linux-gnu) libcurl/7.21.1 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Protocols: dict file ftp ftps http https imap imaps ld...

How to write this crawler in php ?

I need to create a php script. The idea is very simple: When I send a link of a blogpost to this php script, then the webpage is crawled and the first image with the title page are saved on my server. What PHP function I have to use for this crawler ? ...

How can I implement my PHP curl request to Python

This PHP code below fetches html from server A to server B. I did this to circumvent the same-domain policy of browsers. (jQuery's JSONP can also be used to achieve this but I prefer this method) <?php /* This code goes inside the body tag of server-B.com. Server-A.com then returns a set of form tags to be echoed in the body tag...

How to quickly deploy assets to Amazon S3 with an Ant target?

What is the quickest way to deploy content to a CDN with an Ant target? My Ant target is running on a continuous integration server (Hudson). My current solution uses curl and is a bit slow. Should I use wput or something else and how would I do that in ant? <target name="Deploy"> <for param="file"> <path> <fileset dir=...

Using Curl to download files that require logging in

I need to download movie files from a website that requires logging in. I started prototyping a script using Mechanize, but I'm wondering if Curl supports sending username and password to the server, which would make my work a lot faster. ...

Coop API - posting with PHP

I'm trying to do a simple post to a web service using CURL and their API but I'm getting a 422 response. My code looks like: include 'CurlRequest.php'; $secret_key = 'mykeyhere'; $group_id = 'group_id'; $postData = array( 'group_id' => $group_id, 'key' => $secret_key, 'status' => 'test' ); $curl = new CurlRequest('http://...

Problems using cURL with C and non top-level URLs

I'm using cURL to scrape web pages but I can only seem to scrape top-level URLs. For example, if I want to cURL the URL "http://www.businessweek.com/news/2010-09-29/flaherty-says-canada-july-gdp-report-tomorrow-may-be-negative.html" then it returns nothing (as if it's a blank page). This is my C code: #include <stdio.h> #include <curl/...

PHP cURL post without returning page content

Is it possible to do a cURL post with PHP that will post my array of values and return only the curl_getinfo data but none of the page content? Here is an example of what I am currently using; it returns the page content into a variable. However, every time it returns the page content it uses a lot of bandwidth. I'm trying to reduce the...

Does CURLOPT_NOBODY still download the body - using bandwidth

I'm performing a cURL post with PHP and trying to reduce the amount of bandwidth I am using. I don't need anything back from the remote site I am posting to since I control the remote site all my tracking to make sure the post was successful is done on the receiving end. My questions is... When you set CURLOPT_NOBODY to TRUE: Does it ...

Control "virtual web browser" in any language

I would like to know if there is a solution to control a "virtual web browser" with any language (but preferably PHP or C#). This "virtual web browser" would be have just like a normal one, but it is completely hidden from the user. This means the Javascript is executed and javascript cookies handled. I want to use this to login to a si...

How .bat can check if curl or wget exist

In my .bat file, how can I check if wget or curl are available in the system through whatever other previous installations the user may have went through. Is this check possible, and can I have if then else logic in my file to react differently, like we do in normal programming. I basically want to use wget or curl to download a file. I...