archiv:coding:php:pushmeto

Dies ist eine alte Version des Dokuments!


vorlagen:delete

Pushme.to PHP Template

Siehe auch: HTTP Socket MSL

 
<?
/* Insert your 32 byte long hash ID here */
$url = "http://pushme.to/q/widget/export/?hash=00000000000000000000000000000000";
/* Configuration is done! */
 
$msg= $_GET[msg];
$nick = $_GET[nick];
 
pushmeTo ($url,$msg,$nick);
 
function pushMeTo($widgeturl,$text,$signature) {
	$agent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12";
	if (!function_exists("curl_init")) die("pushMeTo needs CURL module, please install CURL on your php.");
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $widgeturl);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_USERAGENT, $agent);
	$page = curl_exec($ch);
	preg_match("/form action=\"(.*?)\"/", $page, $form_action);
	preg_match("/textarea name=\"(.*?)\"/", $page, $message_field);
	preg_match("/input type=\"text\" name=\"(.*?)\"/", $page, $signature_field);
	$ch = curl_init();
	$strpost = $message_field[1].'=' . urlencode($text) . '&'.$signature_field[1].'=' . urlencode($signature);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $strpost );
	curl_setopt($ch, CURLOPT_URL, $form_action[1]);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_USERAGENT, $agent);
	$page = curl_exec($ch);
}
 
 
?>
  • archiv/coding/php/pushmeto.1699220881.txt.gz
  • Zuletzt geändert: 2023/11/05 22:48
  • von psycore