curl

share the same cookie between two website using PHP cURL extension

I want to get the contents of some emails in my gmail account. I would like to use the PHP cURL extension to do this. I followed these steps in my first try: In the PHP code, output the contents of https://www.google.com/accounts/ServiceLoginAuth. In the browser, the user input username and password to login. In the PHP code, save cook...

How to get response from secure site (https) using curl in php?

Hi, i have used below code for reading the response from HTTTPS secured site using curl but it shows an error like 'Page can't be displayed" curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true); curl_setopt($ch, CURLOPT_URL, $gatewayURI); curl_s...

Posting status via Facebook's graph api

In PHP, I am trying to post a status to our Facebook fan page using the graph api, despite following the intructions facebook give, the following code does not seem to update the status. Here is the code; $xPost['access_token'] = "{key}"; $xPost['message'] = "Posting a message test."; $ch = curl_init('https://graph.facebook.com/{pag...

Upload image using CURL + PHP via remote form

I have a few images that i need to upload using an online form. So far here's my code $info = array('test title','1234','virginia','@'.realpath('e:\wamp\www\1.jpg'),'@'.realpath('e:\wamp\www\2.jpg'),'@'.realpath('e:\wamp\www\3.jpg'),'@'.realpath('e:\wamp\www\4.jpg'),'test description'); $post->postAd($url, $info); The $info array is ...

Saving a remote image with cURL?

Morning all, Theres a few questions around this but none that really answer my question, as far as I ca understand. Basically I have a GD script that deals with resizing and caching images on our server, but I need to do the same with images stored on a remote server. So, I'm wanting to save the image locally, then resize and display ...

Why is curl in Ruby slower than command-line curl?

I am trying to download more than 1m pages (URLs ending by a sequence ID). I have implemented kind of multi-purpose download manager with configurable number of download threads and one processing thread. The downloader downloads files in batches: curl = Curl::Easy.new batch_urls.each { |url_info| curl.url = url_info[:url] curl...

WWW::Mechanize VS Curl

Hi, Background: I need to get updated data for all of my users. The data resides on a secure site so the script needs to login (using cookies) Traverses some inner URLs and then fetch the required data. Tools: WWW::Mechanize or Curl What is the best tool for my needs? Performance is a big issue I need to get th...

Facebook API - delete status

In PHP, I'm using curl to send a delete to the fb graph api - and yet I'm getting the following error; {"error":{"type":"GraphMethodException","message":"Unsupported delete request."}} The code I'm using is; $ch = curl_init("https://graph.facebook.com/" . $status_id . ""); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CU...

CURL on PHP 5.2 works in CLI but not in IIS

I have a Windows 2003 Server running IIS with php 5.2.8, I'm trying to use CURL, and it works in CLI mode (if i execute php.exe) but it does not seem to be registered when running under IIS. The output of PHP info in both CLI and IIS show the same 'Loaded Configuration File', but under IIS it does not give the CURL info box. c:\progra...

Assistance with CC Processing script

I am currently implementing a credit card processing script, most as provided by the merchant gateway. The code calls functions within a class and returns a string based on the response. The end php code I am using (details removed of course) with example information is: <?php $gw = new gwapi; $gw->setLogin("username", "password"); $gw-...

How do I retrieve twitter xml for Flash site via php properly

Am I using TwitterScript to retrieve Twitter data for inside a Flash site. Due to Twitter's crossdomain policy, I need to setup a php proxy... Firstly I made a simple one <?php $url = $_GET['url']; readfile($url); ?> but I then get this error URL file-access is disabled in the server configuration which is only resolved by getting...

POSTing a form using Python and Curl

I am relatively new (as in a few days) to Python - I am looking for an example that would show me how to post a form to a website (say www.example.com). I already know how to use Curl. Infact, I have written C+++ code that does exactly the same thing (i.e. POST a form using Curl), but I would like some starting point (a few lines from w...

Multiple HTTP request - Rails

My application checks a number of domains to see if they are valid (approx 100). I have the following code to check a single domain: def self.test_url uri, limit = 10 if limit == 0 return get_error_messages("001") end begin url = URI.parse(uri) response = Net::HTTP.start(url.host, url.port).request_...

Yahoo Video Upload with cURL

I want to use cURL to post a video to Yahoo Video. I planned to make two calls to yahoo as follows: call to sign in to an existing account and store the returned cookie call to send the cookie, collected video metadata (title, description, etc.), AND the file But the problem is that apparently, the original Video Upload form sends th...

Update post via Typepad API

Hello, I'm trying to update post in my TypePad blog using PHP and cURL, but I can't get it to work. Code follows $ch = curl_init($post['url']); $wsse = new WSSE($credentials['login'], $credentials['password']); $wsseHeader = $wsse->get_header(); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post[...

What's the fastest way to scrape a lot of pages in php?

I have a data aggregator that relies on scraping several sites, and indexing their information in a way that is searchable to the user. I need to be able to scrape a vast number of pages, daily, and I have ran into problems using simple curl requests, that are fairly slow when executed in rapid sequence for a long time (the scraper runs...

How to mass-fetch pages from a website behind authentication in PHP

Yes, yes, i know user and password. I need some trick in php to get logged into a website and retrieve some images/contents, like a normal website. Obviously with a curl o file_get_contents it doesn't work because i'm not authenticated. How i can do? The authentication is normal HTTP auth with POST. Edit: ok thanks for help it works...

Facebook Connect PHP SDK Curl Peer SSL Verification Error

I'm integrating Facebook Connect into our application. I thought using Facebook Official SDK at http://github.com/facebook/php-sdk is the best way, as it is advertised on FB Developers wiki. But I couldn't manage to make it work. When investigating the API code, I remembered my previous experiences about CURLOPT_SSL_VERIFYPEER parameter...

Extract paragraphs from Wikipedia API using PHP cURL

Here's what I'm trying to do using the Wikipedia (MediaWiki) API - http://en.wikipedia.org/w/api.php Do a GET on http://en.wikipedia.org/w/api.php?format=xml&amp;action=opensearch&amp;search=[keyword] to retrieve a list of suggested pages for the keyword Loop through each suggested page using a GET on http://en.wikipedia.org/w/api.php?...

how to get contents of site use HTTPS

ex of site using ssl ( HTTPs ) : https://www.eb2a.com 1 - i tried to get its content using file_get_contents, but not work and give error ex : <?php $contents = file_get_contents("https://www.eb2a.com/"); echo $contents; ?> 2 - i tried to use fopen, but not work and give error ex: <?php $url = 'https://www.eb2a.com/'; $contents = f...