Skip to content

VedDecoder is a decoder for the Google ved parameter

License

Notifications You must be signed in to change notification settings

serpapi/ved_decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VedDecoder

VedDecoder is a decoder for the Google ved parameter.

Links to ved's explanations:

Installation

Add this line to your application's Gemfile:

gem 'ved_decoder'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install ved_decoder

Usage

# Decode ved starts with '1'
v = VedDecoder.decode('1t:22,r:6,i:86,s:90')
# => <VedDecoder::Ved: index: 86, type: 22, result_position: 6, start_page: 90>

# Decode ved starts with '0' or '2'
v = VedDecoder.decode('2ahUKEwjZ5rDNt67pAhVDLKwKHS4wDD4QzLECKAEwSnoECBYQCg')
# => <VedDecoder::Ved: type: 39116, sub_result_position: 1, result_position: 74>

# Get values
v.to_h
# => {:type=>39116, :sub_result_position=>1, :result_position=>74}
v.type
# => 39116
v.result_position
# => 74

License

The gem is available as open source under the terms of the MIT License.

About

VedDecoder is a decoder for the Google ved parameter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages