File tree Expand file tree Collapse file tree 7 files changed +21
-12
lines changed
Expand file tree Collapse file tree 7 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 3030* .exe
3131* .out
3232* .app
33+
34+ # Build
35+ build
36+
37+ # Editor
38+ .vscode
Original file line number Diff line number Diff line change @@ -7,22 +7,25 @@ all: build run
77
88# initialize meson build
99init :
10- - rm -rf build/
10+ rm -rf build/
1111 meson setup build
1212
1313# build application
1414build :
1515 meson compile -C build -v
16+ cd build && ninja
1617
1718# run application
1819run :
1920 ./build/serpapi-search-cpp
2021
2122# tested on AARCH64 and x86
2223install_linux :
23- sudo apt-get install -f libcurl4-openssl-dev libjsoncpp-dev
24- brew curl jsoncpp
24+ sudo apt update -y && sudo apt install -f -y build-essential meson pkg-config curl cmake meson ninja-build libcurl4-openssl-dev rapidjson-dev
2525
2626# tested on Apple M1 aarch64
2727install_apple :
2828 brew install meson pkg-config curl cmake meson ninja rapidjson
29+
30+ # reset build directory
31+ reset : init
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ task :default do
77 'googlesearch.hpp' ,
88 ]
99 source = 'google'
10- names = %w( bing baidu homedepot yahoo yandex wallmart youtube linkedin )
10+ names = %w( bing baidu homedepot yahoo yandex walmart youtube linkedin )
1111 names . each do |name |
1212 files . each do |fn |
1313 buf = File . read ( fn )
@@ -27,4 +27,4 @@ task :default do
2727 names . each do |name |
2828 puts "serpapi::#{ name . capitalize } Search search(parameter, apiKey);"
2929 end
30- end
30+ end
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ int main()
4343 std::map<string, string> parameter;
4444 parameter[" q" ] = " coffee" ;
4545 parameter[" location" ] = " Austin,TX" ;
46- char * env_p = std::getenv (" API_KEY" );
46+ const char * env_p = std::getenv (" API_KEY" );
4747 std::string apiKey (env_p);
4848 std::string engine = " google" ;
4949
Original file line number Diff line number Diff line change 11project (' serpapi-search-cpp' , ' cpp' ,
22 version : ' 0.1' ,
3- default_options : [' warning_level=3' , ' cpp_std=c++14 ' ])
3+ default_options : [' warning_level=3' , ' cpp_std=c++17 ' ])
44
55dep = [
6- dependency (' curl ' ),
7- dependency (' rapidjson ' )
6+ dependency (' libcurl ' ),
7+ dependency (' RapidJSON ' )
88 ]
99
1010executable (' serpapi-search-cpp' ,
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ string SerpApiSearch::GetHtml()
7272 return getRawResult (" /search" , GetParameter (false ));
7373}
7474
75- string SerpApiSearch::getRawResult (string uri, string parameter)
75+ string SerpApiSearch::getRawResult (string uri, string parameter)
7676{
7777 curl_global_init (CURL_GLOBAL_DEFAULT);
7878 curl = curl_easy_init ();
@@ -121,4 +121,4 @@ Document SerpApiSearch::GetSearchArchive(string searchID)
121121{
122122 return SerpApiSearch::getJsonResult (" /searches/" + searchID + " .json" , SerpApiSearch::GetParameter (true ));
123123};
124- };
124+ };
Original file line number Diff line number Diff line change @@ -51,4 +51,4 @@ class SerpApiSearch {
5151};
5252}
5353
54- #endif
54+ #endif
You can’t perform that action at this time.
0 commit comments