This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef HTMLCRAWLER_H | |
#define HTMLCRAWLER_H | |
#include <iostream> | |
#include <fstream> | |
#include <curl/curl.h> | |
#include <fstream> | |
#include <stdio.h> | |
#include <libxml2/libxml/HTMLparser.h> | |
#include <libxml2/libxml/tree.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LISTENER_H | |
#define LISTENER_H | |
#include <cpprest/http_listener.h> | |
#include <cpprest/json.h> | |
using namespace web::http::experimental::listener; | |
using namespace web::http; | |
using namespace web; | |
using namespace utility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Listener.h" | |
Listener::Listener(utility::string_t url) : m_listener(url) | |
{ | |
m_listener.support(methods::GET, std::bind(&Listener::handle_get,this,std::placeholders::_1)); | |
m_listener.support(methods::PUT, std::bind(&Listener::handle_put,this,std::placeholders::_1)); | |
m_listener.support(methods::POST, std::bind(&Listener::handle_post,this,std::placeholders::_1)); | |
m_listener.support(methods::DEL, std::bind(&Listener::handle_delete,this,std::placeholders::_1)); | |
} | |
void Listener::handle_get(http_request message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef LAZY_LISTENER_H | |
#define LAZY_LISTENER_H | |
#include "Listener.h" | |
#include <cpprest/http_listener.h> | |
#include <cpprest/json.h> | |
using namespace web::http::experimental::listener; | |
using namespace web::http; | |
using namespace web; | |
using namespace utility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "LazyListener.h" | |
LazyListener::LazyListener(utility::string_t url) : Listener::Listener(url) | |
{ | |
} | |
void LazyListener::handle_get(http_request message) | |
{ | |
json::value obj; | |
std::cout << message.to_string() << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "LazyListener.h" | |
#include <unistd.h> | |
int main(void) | |
{ | |
utility::string_t address = ("http://localhost:8081/keyboard"); | |
uri_builder uri(address); | |
auto addr = uri.to_uri().to_string(); | |
LazyListener * lazy = new LazyListener(addr); | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef MESSAGE_LISTENER_H | |
#define MESSAGE_LISTENER_H | |
#include "Listener.h" | |
#include <cpprest/http_listener.h> | |
#include <cpprest/json.h> | |
#include <map> | |
#include <string> | |
using namespace web::http::experimental::listener; | |
using namespace web::http; | |
using namespace web; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MessageListener.h" | |
#include "../HTMLCrawler.h" | |
#include <fstream> | |
#include <regex> | |
#include <locale> | |
static inline void ltrim(std::string &s) | |
{ | |
s.erase(s.begin(), std::find_if(s.begin(), s.end(),std::not1(std::ptr_fun<int, int>(std::isspace)))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MessageListener.h" | |
#include <unistd.h> | |
int main(void) | |
{ | |
utility::string_t address = ("http://localhost:8082/message"); | |
uri_builder uri(address); | |
auto addr = uri.to_uri().to_string(); | |
MessageListener * msg = new MessageListener(addr); | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### hyper-v 백업 스크립트 (GIT-server) 제외 #### | |
### 인자 type: (month, week) | |
Param ( | |
[Parameter(Mandatory=$true)] | |
[ValidateSet("Month","Week")] | |
[String]$Type | |
#TODO:일시 백업시 저장공간 추가 | |
) |
OlderNewer