
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
A Ruby client to call Baidu LBS Cloud API
Add this line to your application's Gemfile:
gem 'baidu_api-lbs_cloud'
And then execute:
$ bundle
Or install it yourself as:
$ gem install baidu_api-lbs_cloud
require 'baidu_api/lbs_cloud'
# Call Geodata APIs
# :sk is unnecessary if you are not authenticating with SN
BaiduApi::LbsCloud::V3::Geodata.setup ak: 'xxxx', sk: 'xxxxx'
# Also :ak and :sk can be Proc if you want load them dynamically
BaiduApi::LbsCloud::V3::Geodata.setup ak: ->{ Settings.current.ak } , sk: -> { Settings.current.sk }
# get geodata singleton instance
geodata = BaiduApi::LbsCloud::V3::Geodata.instance
# list existing geotables
geodata.geotable.list()
=> {"status"=>0,
"geotables"=>
[{"name"=>"5656", "geotype"=>1, "is_published"=>1, "create_time"=>1420180426, "modify_time"=>1420180426, "id"=>90286},
{"create_time"=>1419816767, "geotype"=>1, "is_published"=>1, "modify_time"=>1420180449, "name"=>"gogo", "id"=>89998}],
"size"=>2,
"message"=>"成功"}
# create geotable
geodata.geotable.create(name: 'mytest', geotype: 3, is_published: 0)
=> {"status"=>0, "id"=>90288, "message"=>"成功"}
# rails error if status is non-zero
geodata.geotable.create!(name: 'mytest')
BaiduApi::LbsCloud::Exceptions::Failed: geotype:参数必需
# Call Geosearch APIs
BaiduApi::LbsCloud::V3::Geosearch.setup ak: 'xxx', sk: 'xxx'
geosearch = BaiduApi::LbsCloud::V3::Geosearch.instance
geosearch.local(geotable_id: 89998)
=> {"status"=>0,
"total"=>2,
"size"=>2,
"contents"=>
[{"title"=>"qqq",
"location"=>[116.401147, 39.899501],
"city"=>"北京市",
"create_time"=>1419816873,
"geotable_id"=>89998,
"address"=>"北京市西城区煤市街146号",
"province"=>"北京市",
"district"=>"西城区",
"uid"=>585565808,
"coord_type"=>3,
"type"=>0,
"distance"=>0,
"weight"=>0},
{"title"=>"oo",
"location"=>[116.407682, 39.902137],
"city"=>"北京市",
"create_time"=>1419817076,
"geotable_id"=>89998,
"address"=>"北京市东城区得丰西巷25号",
"province"=>"北京市",
"district"=>"东城区",
"icon_style_id"=>"sid1",
"uid"=>585567281,
"coord_type"=>3,
"type"=>0,
"distance"=>0,
"weight"=>0}]}
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that baidu_api-lbs_cloud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.