hamzaemre / easycurl

EasyCurl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EasyCurl

EasyCurl a very easy cURL class.

Settings

Referer and User agent option. The default values included.

require "easycurl.class.php";
$curl = new EasyCurl;
$curl->referer = "http://google.com";
$curl->user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6";

Get

$val = $curl->get("http://google.com");
echo $val;

Post

$arrayName = array(
	"author" => "ufuk",
 	"url" => "ufukk.com",
 	"comment" => "I'm bot....",
 	"submit" => "Send",
 	"comment_post_ID" => "193",
 	"comment_parent" => "0",
 	"akismet_comment_nonce" =>"faed9d1dcd",
 	"ak_js" => "218");
$curl->post("http://site.com/wp-comments-post.php", $arrayName);

Download

$curl->download("http://site.com/image.jpeg", "images/image.jpeg");

Preg

$val = $curl->get("http://site.com/");
//Example Value: <p>Content</p>
echo $curl->preg("<p>", "</p>", $val);
//Content

About

EasyCurl

License:GNU General Public License v2.0


Languages

Language:PHP 100.0%