@@ -153,7 +153,7 @@ until schedule_search.empty?
153153 next
154154 end
155155
156- schedule_search.push(result )
156+ schedule_search.push(search_id )
157157end
158158
159159schedule_search.close
@@ -173,7 +173,7 @@ require 'connection_pool'
173173
174174# create a thread pool of 4 threads with a persistent connection to serpapi.com
175175pool = ConnectionPool .new (size: n, timeout: 5 ) do
176- SerpApi ::Client .new (engine: ' google' , api_key: ENV [' SERPAPI_KEY' ], timeout: 30 , persistent: true )
176+ SerpApi ::Client .new (engine: ' google' , api_key: ENV [' SERPAPI_KEY' ], timeout: 30 , persistent: true )
177177end
178178
179179# run user thread to search for your favorites coffee type
@@ -205,18 +205,19 @@ benchmark: (demo/demo_thread_pool.rb)
205205
206206``` ruby
207207require ' serpapi'
208-
209208require ' pp'
210209
211210client = SerpApi ::Client .new (api_key: ENV [' SERPAPI_KEY' ])
212211params = {
213212 q: ' coffee'
214213}
215214results = client.search(params)
215+
216216unless results[:organic_results ]
217- puts ' organic results found'
217+ puts ' no organic results found'
218218 exit 1
219219end
220+
220221pp results[:organic_results ]
221222puts ' done'
222223exit 0
@@ -253,7 +254,7 @@ it prints the first 3 locations matching Austin (Texas, Texas, Rochester)
253254]
254255```
255256
256- NOTE: api_key is not required for this endpoint.
257+ NOTE: ` api_key ` is not required for this endpoint.
257258
258259### Search Archive API
259260
0 commit comments