curl

XMLRPC Not working on Localhost

Hey guys, I've been working on a Wordpress theme for a while now and all works fine when it's on my server, but when I load it up on my machine locally I am unable to utilise certain functionality, namely the ability to post from outside the admin panel. To do this I use XMLRPC and the following code - $params = array(0,$username,$passw...

problem fetching a jsp page using curl

I'm using LIVE HTTP headers to sniff the HTML traffic and to mimic it using curl. The page I'm trying to get is a .jsp and I noticed that some data has been added to the cookie. I'm using the cookie I retrieved when log in to the site. This is the link: https://direct.orange.co.il/selfservice/info/notLoggedUser/notLoggedIn.jsp?loginTo...

Convert CURL command line to Python script

Having way too much trouble making this cmd line curl statement work in python script...help! Attempting to use URLLIB. curl -X POST "http://api.postmarkapp.com/email" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "X-Postmark-Server-Token: abcdef-1234-46cc-b2ab-38e3a208ab2b" \ -v \ -d "{From: 'sender@email....

Multiple curl url

Hello there! I want to get several xml-feeds using curl. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $feed); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); $data = curl_exec($ch); curl_close($ch); $doc = new SimpleXmlElement($data, LIBXML_NOCDATA); function parseRSS($xml) { $cnt = ...

how to collect contacts from different accounts

hi so i was wondering this: for example: when you subscribe to Facebook you have the option to invite your friends from gmail(if you have a gmail account), so you would enter your gmail login and password and facebook would grab all your contacts from gmail, so i was wondering how this is done? is there an API from Gmail or from Hotmail...

[PHP CURL] Is it possible do only download a portion of a binary file

Hi! A small question concerning downloading xml files from a remote server. I am using curl to achieve this. The information I need in those xml files are located in the first couple of lines of code. Now my question is : Is it possible to download only a portion ( or a defined amount of bytes ) from these xml files , so I only have t...

PHP function to grab all links inside a <DIV> on remote site using scrape method

Anyone has a PHP function that can grab all links inside a specific DIV on a remote site? So usage might be: $links = grab_links($url,$divname); And return an array I can use. Grabbing links I can figure out but not sure how to make it only do it within a specific div. Thanks! Scott ...

how can i 'flush' my cURL session's memory without opening a new session?

I am writing a scraper in PHP using cURL but am experiencing some memory issues. These memory issues arise since i am using a single cURL session to log in to a website, and then to scrape many pages. Is there a way to 'flush' the cURL session's memory without having to close the session, open another one and re-log in? Perhaps I coul...

Grabbing framed pages with PHP and CURL?

I've been trying to write a script which grabs a page with two frames using CURL, but I haven't had any luck. The problem is that the urls of the two pages (to be displayed in the frames) are relative, and CURL ends up searching my server for the files, which obviously they aren't located on. As a result I get an error message saying the...

POST binary file with cmd line curl using headers contained in the file

I'm trying to send a binary file to a server over HTTP. The beginning of the file contains headers already I'm trying to send a file using command line version of curl for windows like so: C:>curl -H "Content-Type:application/octet-stream" --data-binary @asdf.file http://server:1234/url Curl is adding headers which cause a 400 Bad Re...

Ending a cURL Request

I'm trying to make a sort of PHP bot. The idea is to have to php files, named a.php and b.php. a.php does something, then sleeps 30 seconds, calls b.php, b.php ends the Http request, does some processing, and then calls a.php, which ends the Http request, and so on. Only problem now is how to end the Http reqest, made using cURL. Ive tr...

How to Install Latest Libcurl Package in WAMP

I am aware of how to enable the php_curl.dll file by uncommenting the ; from within php.ini When I do that however, the version of curl provided with a default WAMP install is 7.19.2 at the moment (Oct 2010). I am in need of the latest libcurl version which is 7.21.2 to be working together with PHP and Apache on a Windows 7 32 bit OS. ...

convert python request to PHP-cURL equivalent

I am sending a POST request to a URL. It works correctly in python but in php-curl, I always get a bad request error (i.e. my POST data is not as expected by the server) Python code: (works correctly. 200 OK) import httplib, urllib, json def SendRequest(param1): url = "api.xyz.com" body = {"version": "1.0", "data":[{"param1":p...

$_POST is empty in php

I have gone through all the responses in this post print_r($_POST); ===> returns empty array print_r($_SERVER); Array ( [HTTP_HOST] => localhost [HTTP_ACCEPT] => */* **[HTTP__CONTENT_TYPE]** => application/json; charset=UTF-8" [CONTENT_LENGTH] => 942 **[CONTENT_TYPE]** => application/x-www-form-urlenc...

How my rails app can handle twitter echo & verify_credentials.json?

How my rails app can handle the incoming headers of a request like: curl -v -H 'X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json' -H 'X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/", oauth_consumer_key="yTrEIQH6jhtmLUypg8T5", oauth_signature_method="HMAC-SHA1", oauth_to...

Save a webpage to memory in C++ using cURL

I have been successful in saving a webpage to memory using a structure. But is it possible do it using a class? I am having trouble accessing the write data function inside the class. Since I am writing from my mobile, I am unable to insert code snippets. ...

cURL , get redirect url to a variable

Hi, I am currently using curl to fill an form, but after completion of the post, the other script which handles the form is redirecting to other url , now I want to get the url , for which the script is redirecting to a variable. Thanks.. ...

PHP Application - Quick connection to HTTPS server

Hello there, The problem is, what I want to develop an application (probably PHP?), capable of making quick connection to a SSL secured server and send/get data from it. My aim is to make it send the query and read the result as quick as possible. I am trying various solutions and benchmarking them all. I have tried fsockopen() and CURL,...

How do I enter 1300 CSV records into a web form?

Hi, I've got a fairly extensive data entry task to perform in a PHP application. The application allows you to enter one data set at a time (first name, last name, email), click 'Go', and then uses AJAX to submit the data and blanks the form, putting your cursor back in the first input. I have a data set of 1,300 that needs to be entere...