$attribute_name = 'body_'.$lang;
$model->$attribute_name = implode($body);
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://forklog.com/wp-content/themes/newForklog/ajaxposts.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "action=PostsByCat&offset=12&postperpage=12&category=news/&tag=news/");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = "Referer: https://forklog.com/news/";
$headers[] = "Content-Type: application/x-www-form-urlencoded; charset=UTF-8";
$headers[] = "X-Requested-With: XMLHttpRequest";
$headers[] = "Connection: keep-alive";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
using System;
using MailKit.Net.Imap;
using MailKit;
namespace MailKit_app
{
class Program
{
static void Main(string[] args)
{
using (var client = new ImapClient())
{
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect("imap.yandex.ru", 993, true);
client.Authenticate("login@yandex.ru", "password");
var junk = client.GetFolder(SpecialFolder.Junk);
junk.Open(FolderAccess.ReadOnly);
Console.WriteLine("Total messages: {0}", junk.Count);
Console.WriteLine("Recent messages: {0}", junk.Recent);
for (int i = 0; i < junk.Count; i++)
{
var message = junk.GetMessage(i);
Console.WriteLine("Subject: {0}", message.Subject);
}
client.Disconnect(true);
}
}
}
}
function _replace(&$str, &$trans){
$arr = preg_split('//u', $str, null, PREG_SPLIT_NO_EMPTY);
for ($i = 0; $i < count($arr); $i++) {
if( isset($trans[$arr[$i]]) && rand(0,1)) {
$arr[$i] = $trans[$arr[$i]];
}
}
$str = implode('', $arr);
}