Авг 07
jQuery, jCarousel, немного PHP и HTML/CSS и получится такая навигация, как у меня внизу на главной. При желании можно доделать до любой формы. Еще это минус один плагин, что есть гуд в плане ресурсов. read all »
Июл 26
Под систему – проект от яндекса, бесплатный – Mystem.
PHP – phpmorphy, про него также тут, на phpclub и у деды Гринвуда
Июл 08
Можно интегрировать в свой блог, и пост автоматом уйдет в твиттер, можно встроить в админку и писать в твиттер из админки вп. Применений масса.
<?php
// Set username and password
$username = 'username';
$password = 'password';
// The message you want to send
$message = 'is twittering from php using curl';
// The twitter API address
$url = 'http://twitter.com/statuses/update.xml';
// Alternative JSON version
// $url = 'http://twitter.com/statuses/update.json';
// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer)) {
echo 'message';
} else {
echo 'success';
}
?>
Июл 07
У курла есть много вариантов использования )
<?php
$postfields = array();
$postfields["action"] = "submit";
$postfields["author"] = "Spammer";
$postfields["email"] = "spammer@spam.com";
$postfields["url"] = "http://www.iamaspammer.com/";
$postfields["comment"] = "I am a stupid spammer.";
$postfields["comment_post_ID"] = "123";
$postfields["_wp_unfiltered_html_comment"] = "0d870b294b";
//Url of the form submission
$url = "http://www.ablogthatdoesntexist.com/blog/suggerer_site.php
?action=meta_pass&id_cat=0";
$useragent = "Mozilla/5.0";
$referer = $url;
//Initialize CURL session
$ch = curl_init($url);
//CURL options
curl_setopt($ch, CURLOPT_POST, 1);
//We post $postfields data
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
//We define an useragent (Mozilla/5.0)
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
//We define a refferer ($url)
curl_setopt($ch, CURLOPT_REFERER, $referer);
//We get the result page in a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//We exits CURL
$result = curl_exec($ch);
curl_close($ch);
//Finally, we display the result
echo $result;
?>
Июл 07
Оч полезный ман по курлу, можно много дел сделать не выходя из консоли.
Например залить файл
curl -T uploadfile www.uploadhttp.com/receive.cgi
http://rus-linux.net/MyLDP/internet/curlrus.html
Читать строго под такую музыку!
Июл 06
Данной функцией можно постить в вп.
function wpPostXMLRPC($title,$body,$rpcurl,$username,
$password,$category,$keywords='',$encoding='UTF-8')
{
$title = htmlentities($title,ENT_NOQUOTES,$encoding);
$keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
$content = array(
'title'=>$title,
'description'=>$body,
'mt_allow_comments'=>0, // 1 to allow comments
'mt_allow_pings'=>0, // 1 to allow trackbacks
'post_type'=>'post',
'mt_keywords'=>$keywords,
'categories'=>array($category)
);
$params = array(0,$username,$password,$content,true);
$request = xmlrpc_encode_request('metaWeblog.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
$results = curl_exec($ch);
curl_close($ch);
return $results;
?>
Июл 05
Не держит сабж по умолчанию прокси.
Из скриптов можно переустанавливать прокси так
echo http_proxy=http://ip:port > ~/.wgetrc
пара манов по wgetrc
http://osr507doc.sco.com/cgi-bin/info2html?(wget.info.gz)Wgetrc%2520Commands〈=en
http://linuxland.itam.nsc.ru/book/linux03/node106.html
Май 09
Вроде везде говорится, что да. При стандартном открытии файлов в пхп возможно и быстрее, но ведь можно считывать содержимое файла через системный вызов при помощи cat.
Сделал два файла, один подключался к базе, считывал заголовок этого блога, выводил его. Второй считывал файл в переменную и далее грепом выбирал заголовок. Результаты не в пользу бд: разброс значений от 0,047 мс до 0,128мс. Файлы стабильно показывали 0,05мс.
Интересовала скорость простого запроса, без сложных условий выборки, хотя и по файлам через системный вызов можно grep’ом отфильтровать как надо.
read all »
Апр 16
Небольшой скриптец на php, поможет установить сразу n вордпрессов, код открыт, можно интегрировать в свои решения. Скрипт под шелл, из веба незнаю будет работать или нет.
read all »