PHP Storm и HumanEmulator

Пример организации работы php скрипта в PHPStorm с рабочей функцией подстановки кода в редакторе. С PHPStorm в работа по созданию скрипта сильно облегчается (отладка и точки останова).

  1. Для корректной работы установим HumanEmulator (далее HE) в отдельную папку по пути:  C:\XWeb\HE 4.9.39 PHP STORM
  2. Заменяем файл php.ini, который находится
    C:\XWeb\HE 4.9.39 PHP STORM\PHP\php.ini на файл C:\XWeb\HE 4.9.39 PHP STORM\PHP\ php.ini-phpstorm назвав его тем же именем
  3. Запускам PHP Storm и в мастере первого запуска выбираем «Открыть». Выберем папку HE (целиком) путь C:\XWeb\HE9.39 PHP STORM.
    phpstormopen2 open2
    Зачем это делается?
    В папке содержится основной код приложения, который будет «виден» движку
    PHP Storm.
  4. Копируем наш готовый рабочий скрипт в основную рабочую папку папку:
    C:\XWeb\HE9.39 PHP STORM\MyScripts
    Для примера у меня будет проект aliexpress. В код скрипта необходима добавит строчку:
    $PHP_Use_Trought_Shell=false;
  5. Настройка конфигурации исполнения
    Для этого открываем конфигурацию Edit Configuration
    PHPStrorm editconfiguration 1 step
    Add New ConfigurationPHPStrorm editconfiguration 2step
    Добавляем PHP ScriptУстанавливаем путьPHPStrorm editconfiguration 3 step к файлу скрипта с которого происходит исполнение и имя этой конфигурации и нажимаем OKPHPStrorm editconfiguration 4 step
  6. Настройка интерпретатора. PHP Storm требует установить интерпретатор, в нашем случае он находится в каталоге PHP.
    Для установки интерпретатора главное меню File/Settings/PHP создаем новый и выбираем путь к нему.
    setinterpretatoradd find path
  7. Запускаем приложение HE на порту 7010. Приложение будет работать как сервер и браузер, который будет отрабатывать команды находится в окне HE.
  8. Запуск скрипта по кнопке запуска PHP STORM
    phpstromstart
  9. Остановка скрипта по кнопке стоп, в панели отладки окна PHP STORM
    phpstormstopscript

Все настройки PHP STORM будут сохранены и уже для запуска приложения нужно будет исполнять только 8 пункт описания и соответственно для остановки пункт 9.

Подключение всех папок HE  необходим для корректной работы главного преимущества PHP Storm удобных функций подстановки кода.

intellysense

Так как лог в приложении HE ориентирован на исполнение в окне браузера встроенного в приложение, лог содержит символ переноса <br> и лог отображенный в панели PHP STORM в функции вывода сообщений лога в одну строчку, что мешает его корректно воспринимать. Можно добавит символ переноса строки \n в конце (после <br>) и лог будет выводится корректно.

К сожалению  функция $folder_path = $debug->get_cur_script_folder(); возвращает некорректный результат (пустое значение) нужно заменить эту часть стандартной функцией $folder_path = getcwd();

P.S.

Запуск обычного скрипта на чистой версии phpStorm

Для запуска скрипта на чистой версии phpStorm не используя готовую конфигурацию из HE без привязки к серверной части необходимо.

1. Создать новый проект с phpStorm File/New project определить в меню корневую папку.

2. Настройка конфигурации исполнения Edit Configuration. Тип конфигурации PHP Script. Определить в ней Интерпретатор, как путь к файлу php.exe в моем случае это C:\Program Files\php-x64\php.exe (там свой php.ini). 

Определить файл в проекте для исполнений (точка входа).

3. Настроить отладку при помощи XDebug. Скачать бинарник XDebug и поместить в папку C:\Program Files\php-x64\ext и переименовать его в php_xdebug.dll. Добавить в php.ini строку в конец текста zend_extension=php_xdebug.dll

Остальные расширения (ext) подключать тем же образом.

Email checker by SMTP | Проверка списка email-ов на валидность

SMTP (Simple Mail Transfer Protocol) — это сетевой протокол, предназначенный для отправки электронной почты. Клиент и SMTP почтовый сервер обмениваются информацией пока соединение не будет закрыто.

Задача

Существует задача по проверке списка email-ов на валидность (существует ли указанный адрес). Очевидным способом ее решить, это послать по этим адресам письма и если сервер вернет ошибку типа «Mail delivery failed» значит таких адресов не существует. Однако почтовые серверы не любят подобные действия и могут забанить аккаунт.

Поиск решения

Потратил некоторое количество времени на поиск простого решения в функциональности smtp (тестировал для mail.ru и yandex.ru).

Существует две команды, которые могут быть выполнены без посылки письма серверу, это:

VRFY — команда для проверки существует ли пользователь с таким именем, если существует, то код возврата содержит  строчку с данными пользователя.
EXPN- команда для проверки членов почтовой группы, в случае удачного запроса вернет списко членов группы.
Обе команды должны поддерживаться сервером, однако из-за большой активности спамеров проверяющих огромные списки email-ов, на большинстве почтовиков более не работают.
http://stackoverflow.com/questions/3883518/can-i-check-if-an-email-address-exists-using-net
http://www.spamresource.com/2007/01/whatever-happened-to-vrfy.html

Что может предложить HumanEmulator?

К счастью web интерфейс сайтов позволяет сколько угодно запрашивать данные. Например если списки ваших email-ов относятся к серверам mail.ru, то можно воспользоваться Mail.ru агентом. В Агенте существует форма поиска пользователей зарегистрированных в mail.ru, а значит наша цель будет достигнута. Вводим значения в форму и парсим.

 

Ошибка в сборке CefSharp.Example.dll

Попробовал создать Release проекта сделанного на CefSharp для WPF.

CefSharp Quick-Start

Все работало в VisualStudio, однако когда я попробовал запустить скомпилированные файлы в другой папке, то возникла следующая ошибка(не находит папку с ресурсами):

System.IO.DirectoryNotFoundException не обработано
Message: Необработанное исключение типа "System.IO.DirectoryNotFoundException" в CefSharp.Example.dll

Потратив некоторое время я нашел решение. Идем в проект CefSharp.Example, там находим класс CefExample.cs находим там такой код:
settings.RegisterScheme(new CefCustomScheme
{
SchemeName = "localfolder",
SchemeHandlerFactory = new FolderSchemeHandlerFactory(rootFolder: @"..\..\..\..\CefSharp.Example\Resources",
schemeName: "localfolder", //Optional param no schemename checking if null
hostName: "cefsharp", //Optional param no hostname checking if null
defaultPage: "home.html") //Optional param will default to index.html
});

Ошибка здесь в задании пути к ресурсам, в итоге проект ищет ресурсы там где их нет. Заменим код на следующий (замена красным цветом):

string exePath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
settings.RegisterScheme(new CefCustomScheme
{
SchemeName = "localfolder",
SchemeHandlerFactory = new FolderSchemeHandlerFactory(rootFolder: Path.Combine(exePath, "Resources"),
schemeName: "localfolder", //Optional param no schemename checking if null
hostName: "cefsharp", //Optional param no hostname checking if null
defaultPage: "home.html") //Optional param will default to index.html
});

Осталось еще установить в свойствах файлов (html, css, js файлы) ресурсов (папка /Resources ) значение «Копировать в выходной каталог» в значение «Копировать всегда».

Теперь код ищет ресурсы в папке с нашим приложением. Осталось перекомпилировать проект (в папке проекта теперь есть папка /Resources).

Теперь все будет работать.

P.S. Считаю что CefSharp самое адекватное решение для работы с chromium на данный момент.

Image Format

When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Gallery Format

When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Link Format

When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

https://www.templatemonster.com/

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Audio Format

When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Quote Format

 When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Every exit is an entry somewhere else Tom Stoppard

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Video Format

 

https://www.youtube.com/watch?v=_HbjsNaUJ2A

When you need your company to have a new website or if you venture on updating your old webpage with a new look and functionality, the choices are versatile…

Assuming that you will go the easy way and choose a theme for your WordPress website, the overall number of characteristics that you will need to keep in mind narrows down significantly.

But how do you stay focused on what kind of a template you need and what do you want to get from that template?

We recommend focusing on 4 most essential characteristics, each vital for your company’s to have an efficient and long-standing online presence!

These are: Design or Visual Looks; Functionality; Easy Installation and Administering & Google-friendliness.

1: Design or Visual Looks

All the WordPress themes that we have here have had a vast team of professional designers sketching, working and executing the ultimate visual look for it.

With such a wide range of choices at hand, we strongly advise you to stick to the WordPress Theme that is based on your business’ or a closely related field. Either way, thanks to all the diversity here you will be able to choose a Theme that can be either of a formal color scheme with some light colors in it or a more vivid one, featuring bold textures and hues!

2: Functionality

Each business niche may require a unique functionality of its own

Every exit is an entry somewhere else.Tom Stoppard

With that notion in mind, our team of professional WordPress coders has been working day and night to roll out a definitive collection of built-in WordPress plugins, that come with each of our WordPress themes…

3: Easy Installation and Administering

Due to the fact that this is a WordPress theme, the process of installing it and using it is truly as easy as it gets!

Read our documentation to understand how fast you can go from purchasing a TemplateMonster WordPress theme to actually using it as a live skin for your company’s webpage.
Also, the WordPress CMS (Content Management System) allows you to easily change the content (text; multimedia; blocks; pages) of any part of your new theme!

4: Google-friendliness

In the modern days of a very tight online business competition, ranking high in such search engines as Google, Bing or Yahoo is critical.

With the help of our heavy customizations, each of our Business WordPress Themes is enhanced with an optimized features.

Believe us, Google will just love crawling your new website!

All in all, feel free to browse our Business WordPress Themes category and you will definitely find a new look for your company’s website!

Раскрутка сайтов

Популярная тема, у многих сегодня есть сайты и конечно необходимо их раскручивать.

Зачем раскручиваем сайт?

Безусловно сайт раскручивают в зависимости от задач, которые ставятся.
Задачи сайта:

  • продавать рекламу в виде баннеров и ссылок (показы рекламы и клики) для продажи чужого продукта или услуги;
  • сайт для продажи собственного продукта или услуги;
  • сайт социальный;
  • сайт личный, как правило блог. Привлечение читателей;
  • сайт, как часть сети сайтов ведущий на целевой сайт и так далее.

Однако цель раскрутки одна — привлечение посетителей.
Однако нужно ответить на главный вопрос: а что привлеченный человек должен делать на этом сайте, когда пришел на него?
Возможно нужно в первую очередь наполнить сайт качественным контентом. Это важно для любой задачи.

Как к раскрутке относятся поисковые машины?
Конечно поисковые машины к накрутке сайтов относятся очень плохо. Алгоритмы Гугла и Яндекса по выдаче сайтов в поисковых запросы претерпевают постоянные изменения, в связи с тем, что идет их совершенствование. На заре интернета сайтов было мало, а в настоящий момент объемы информации постоянно растут и пользователю трудно найти нужный сайт по своему запросу. Поисковые машины постоянно перемещают ваш сайт в списке выдачи (ранжируют), для того чтобы подсунуть более подходящие сайты. Если сайт стал не актуальным или был заподозрен в черной раскрутке есть шанс вылететь из выдачи. Гугл и Яндекс, очень не любят «внешние ссылки» (ссылки на другие сайты не помеченные тэгом rel=»nofollow»). Ну и конечно главная проблема информационного мира — это уникальность контента (содержимое сайта не должно содержать сочетание слов и выражений из других источников), такой сайт не имеет ценности никакой.

Мысли о раскрутке

Источником данных для подбора нужных ссылок является история запросов самого пользователя. Таким образом мы приходим к первой мысли — что большую роль играет история запросов пользователя.
Пользователь переходя по сайтам выдачи поисковой машины, если не обнаруживает в текущем сайте необходимой информации, практически сразу закрывает его и переходит на следующий. Второй мыслью — пользователь должен задержаться более 30 секунд времени на заинтересовавшем его сайте.
Если на первых 5-10 страницах выдачи поисковой машины, пользователь не находит нужной информации, то он изменяет запрос. Третья мысль — большую роль играет meta тэг keywords (ключевые слова) страницы вашего сайта, а точнее его содержимое. И если вы подобрали неудачные keywords у вас нет шансов удержаться в поиске. Подбор ключевых слов тесно связан с тематикой сайта и лучше, чтобы она была узко специализированна (Например «Ремонт Audi Москва»).
Ну и в подборе поисковой выдачи большую роль играет гео местоположение и язык пользователя.
Как видите все не очень просто.

Пишем бота

Распространенное решение «в лоб» — это написать бота, который будет прикидываться посетителем и будет пользоваться поисковиком и делать переход на сайт. Поисковик будет фиксировать переход на сайт и если таких переходов будет много, то поисковик даст этому сайт более высокий приоритет в поисковой выдаче. А для того, чтобы поисковик думал, что таких людей много бот будет заходить с разных прокси и чистить кукисы.

Есть пару моментов:
1) Прокси необходимо иметь «качественные» (платные). На бесплатные (и иногда платные) гугл реагирует всегда однозначно и ввод капчи ситуацию не исправляет;
Если гугл дал капчу на этот прокси, то использование его в следующие 24 часа не имеет смысла;
2) Количество запросов в день должно быть ограничено. Многократные запросы от одного прокси фиксируются поисковиком (при повторном и последующих проходах), за запрос также идет проход в «глубину» (последующие страницы), запрос за каждую страницу;
3) Если ваша задачей является раскрутка сайта, то бот должен находится на нем не менее 30 секунд. И чего-нибуть там делать, кликать и делать переходы (на картинке тепловая карта сайта от Яндекс метрика);
4) Зачищенные кукисы вызывает резонные подозрения у поисковика (пользователь без истории).

Если у вас сайт уже имеет аудиторию, то использую методы «черной оптимизации» могут привести к потере поисковой позиции.

Белая оптимизация

Про нее очень много написано. Скажу вкратце, главное это содержание сайта и цитируемость его другими сайтами. В Яндексе есть показатель ТИЦ(индекс цитирования), а в Гугле это PR (page rank) это сложные механизмы, с засекреченными алгоритмами. Получить цитируемость можно только со временем или позаботится об этом самостоятельно.

Итог

Многие методики раскрутки, которые вы найдете в интернете являются устаревшими и могут дать обратный эффект(хотя в свое время приносили большое количество просмотров). В любом случае работу по наполнению контентом сайта делать необходимо.