All pastes #1703850 Raw Edit

Someone

public text v1 · immutable
#1703850 ·published 2009-12-06 04:28 UTC
rendered paste body
#!/usr/bin/env php<?phpfunction pastoid($paste){	$url = null;	$post = http_build_query(array(		'content' => $paste,		'type' => '1',		));	$context = stream_context_create(array(	'http' => array (		'method' => 'POST',		'header'=> "Content-type: application/x-www-form-urlencoded\r\n"			. "Content-Length: " . strlen($post) . "\r\n",		'content' => $post		)	)); 	if ($page = fopen('http://pastebin.ca/quiet-paste.php?api=SP43GEwFtvwOAEN9F1BdUZAkTXcEXmep', 'r', false, $context)) {		stream_set_timeout($page, 3.5);		$contents = '';		while (!feof($page)) {			$contents .= fread($page, 8192);		}		if (preg_match('#SUCCESS:\s*(\d*)#is', $contents, $match)) {			$url = 'http://pastebin.ca/'.$match[1];		}		shell_exec('/home/matt/.bin/notify.py "Pasted to Pastebin" "' . $url . '"');		shell_exec('echo "' . $url . '"| xclip -sel clip');	}	return $url;}$paste = file_get_contents('php://stdin');pastoid($paste);