curl

Logging in and using cookies in pycurl

I need to download a file that is on a password protected page. To get to the page manually I first have to authenticate via an ordinary login page. I want to use curl to fetch this page in script. My script first logins. It appears to succeed--it returns a 200 from a PUT to /login. However, the fetch of the desired page fails, with a...

php using CURL to grab whois record

Example: http://www.whois.net/whois/hotmail.com When open in browser, output is shown. When using curl call, it show nothing. What's wrong? I want to return whole page result, then use regular expression to retrieve data at Expiration Date: 29-Mar-2015 00:00:00 line. $postfields= null; $postfields["noneed"] = ""; $queryurl= "http://...

PHP / cURL problem opening remote file

We have a script which pulls some XML from a remote server. If this script is running on any server other than production, it works. Upload it to production however, and it fails. It is using cURL for the request but it doesn't matter how we do it - fopen, file_get_contents, sockets - it just times out. This also happens if I use a Pyth...

Paste to codepad.org using bash or curl

How can I paste to codepad.org from the commandline using curl? ...

Help streaming over http in C++

I'm looking to use a web service that offers a streaming api. This api can typically be used by the java method java.net.URL.openStream(); Problem is I am trying to design my program in C++ and have no idea what libraries (I've heard the cUrl library is very good at this sort of thing) to use, or how to use them to do what I want. The...

Using cURL Handle as Array Key

I'm using curl_multi functions to request multiple URLs and process them as they complete. As one connection completes all I really have is the cURL handle (and associated data) from curl_multi_info_read(). The URLs come from a job queue, and once processed I need to remove the job from the queue. I don't want to rely on the URL to ide...

Boost.ASIO-based HTTP client library (like libcurl)

I am looking for a modern C++ HTTP library because libcurl's shortcomings are difficult to work around by C++ wrappers. Solutions based on Boost.ASIO, which has become the de-facto C++ TCP library, are preferred. ...

Google Mini cURL request returns HTML, should be RAW XML

Hey, I am quering a local google mini box on my network but im getting back HTML and not raw XML as requested. I have the output param set to xml in the GET request. my request is the following: curl http://192.168.20.196/search?q=soccer&output=xml Any help would be much appreciated, Thanks, Matt ...

Asynchronous/parallel HTTP requests using PHP curl_multi

I recently looked into the possibility of making multiple requests with curl. I may not be understanding it fully, so I am just hoping to clarify some concepts. It's definitely a good option if you are fetching content from multiple sources. That way, you can start processing the results from faster servers while still waiting for slowe...

Objective-C Class / Library to send "curl -F"

Hi, I'm looking for some objective-c Curl Library to send a "curl -F ..." command. I just found complicated ways.. is there an easy class which let me send it easy as direct command? Greetings ...

Grab, cache and parse remote XML feed, validation checks in PHP

Currently, I'm grabbing a remote site's XML feed and saving a local copy on my server to be parsed in PHP. Problem is how do I go about adding some checks in PHP to see if the feed.xml file is valid and if so use feed.xml. And if invalid with errors (of which sometimes the remote XML feed somes display blank feed.xml), serve a backup...

An error when compiling using curlpp

I tried to compile first simple example, and see compile error: undefined reference to `curlpp::Cleanup::Cleanup()' In linker options i wrote curl-config --libs, in command line $ curl-config --libs -lcurl What am I doing wrong? ...

Google Docs API. Upload file using curl.

Hi. Anyone know how to post file using curl to the google documents. I write this code: $header[] = "Authorization: GoogleLogin auth=seсretkey"; $header[] = "Content-Type: application/pdf"; $header[] = "Slug: testdoc"; $header[] = "Content-Length: ".$_FILES['file']['size'].""; $url = "http://docs.google.com/feeds/documents/private/full"...

php convert all links to absolute urls

I am writing a website crawler in php and I already have code that can extract all links from a site. A problem: sites use a combination of absolute and relative urls. Examples (http replaced with hxxp as I can't post hyperlinks): hxxp://site.com/ site.com site.com/index.php hxxp://site.com/hello/index.php /hello/index.php hxxp://...

PHP curl and file_get_contents returns the main website located on the server when I enter a valid URL without DNS resolution

When I call the following: file_get_contents('http://whgfdw.ca'); or $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://whgfdw.ca'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_exec($ch); The return value is the HTML of the homepage of the main site located on the local (dedicated) w...

Is there any way to check if a POST url exists?

Is there any way to determine if a POST endpoint exists without actually sending a POST request? For GET endpoints, it's not problem to check for 404s, but I'd like to check POST endpoints without triggering whatever action resides on the remote url. ...

Last.FM API parse with PHP

Hi folks, I'm new to this so bear with my noobish question. Basically I want a user to enter a search phrase into a web-form and for the query to be passed to the lastFM API and return top artists using that phrase based on their "gettopartists" API node. Here's the code I have... function last($q){ $target_url='http://ws.audioscro...

Bash alias to Python script -- is it possible?

The particular alias I'm looking to "class up" into a Python script happens to be one that makes use of the cUrl -o (output to file) option. I suppose I could as easily turn it into a BASH function, but someone advised me that I could avoid the quirks and pitfalls of the different versions and "flavors" of BASH by taking my ideas and mak...

Making a Twitter Bot in PHP?

Hi, I've made a twitter bot using the CURL library for PHP, and a MySQL db. But I would like to expand its functionality by automatically retweeting tweets marked with a certain hashtag. I do not know quite how to do this, so would any of you be willing to point me to a learning resource on how to do this? Or if you really want to, ...

What for do we use CURLOPT_WRITEFUNCTION in PHP's cURL?

Could you describe it in examples, please? ...