Skip to content

Commit bed7a41

Browse files
committed
save latest changes
1 parent fc1cafc commit bed7a41

26 files changed

+140
-425
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 SerpApi
3+
Copyright (c) 2021-2022 SerpApi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
file_set=$(wildcard *.cpp)
2-
app_name=main
3-
4-
.PHONY: build
51

62
all: build run
73

@@ -17,7 +13,7 @@ build:
1713

1814
# run application
1915
run:
20-
./build/serpapi-search-cpp
16+
./build/serpapi-cpp
2117

2218
# tested on AARCH64 and x86
2319
install_linux:

Rakefile

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
# automatic class generations
22
#
3-
task :default do
4-
puts 'automatic class creation'
5-
files = [
6-
'googlesearch.cpp',
7-
'googlesearch.hpp',
8-
]
9-
source = 'google'
10-
names = %w(bing baidu homedepot yahoo yandex walmart youtube linkedin)
11-
names.each do |name|
12-
files.each do |fn|
13-
buf = File.read(fn)
14-
buf.gsub!(source, name)
15-
buf.gsub!(source.capitalize, name.capitalize)
16-
buf.gsub!(source.upcase, name.upcase)
17-
fout = fn.gsub(source, name)
18-
puts "save: " + fout
19-
File.write(fout, buf)
20-
end
21-
end
223

23-
puts 'usage:'
24-
names.each do |name|
25-
puts "#include <#{name}search.cpp>"
26-
end
27-
names.each do |name|
28-
puts "serpapi::#{name.capitalize}Search search(parameter, apiKey);"
29-
end
4+
task :default => [:init, :build, :run]
5+
6+
# initialize meson build
7+
task :init do
8+
sh('rm -rf build/')
9+
sh('meson setup build')
10+
end
11+
12+
# build application
13+
task :build => FileList['*.hpp', '*.cpp'] do
14+
sh('meson compile -C build -v')
15+
sh('cd build && ninja')
16+
end
17+
18+
# run application
19+
task :run do
20+
sh('./build/serpapi-cpp')
21+
end
22+
23+
# tested on AARCH64 and x86
24+
task :install_linux do
25+
sh('sudo apt update -y && sudo apt install -f -y build-essential meson pkg-config curl cmake meson ninja-build libcurl4-openssl-dev rapidjson-dev')
26+
end
27+
28+
# tested on Apple M1 aarch64
29+
task :install_apple do
30+
sh('brew install meson pkg-config curl cmake meson ninja rapidjson')
3031
end

baidusearch.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

baidusearch.hpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

bingsearch.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

bingsearch.hpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

googlesearch.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

googlesearch.hpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

homedepotsearch.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)