Using Google Search REST API in Ruby

前端 未结 2 758
遥遥无期
遥遥无期 2021-02-15 12:46

I\'m trying to do a google search using Ruby, and print the 1st 3 results.

Could anyone point me to a sample code? I\'m unable to find it.

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-15 13:46

    The gem googleajax is there for that:

    require 'googleajax'
    GoogleAjax.referer = "your_domain_name_here.com"
    GoogleAjax::Search.web("Hello world")[:results][0...3]
    

提交回复
热议问题