🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

userstack

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

userstack

0.1.0
Rubygems
Version published
Maintainers
1
Created
Source

Userstack

Travis Status License

This gem provides an access to Userstack.

Installation

Add this line to your application's Gemfile:

gem 'userstack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install userstack

Usage

  • Instantiate an instance of {Userstack::Client} with a valid Access key.

    client = Userstack::Client.new(ACCESS_KEY)
    
  • Parse an useragent.

    result = client.parse('an useragent')
    

Use http

If you are Free plan user, you have to use http scheme.

client = Userstack::Client.new(ACCESS_KEY, use_ssl: false)
result = client.parse('an useragent')

Legacy response

Userstack supports Useragent API response.

client = Userstack::Client.new(ACCESS_KEY, legacy: true)
result = client.parse('an useragent')

example response

{
  "data": {
    "ua_type": "Desktop",
    "os_name": "macOS 10.14 Mojave",
    "os_version": "",
    "browser_name": "Chrome",
    "browser_version": "71.0.3578.98",
    "engine_name": "WebKit/Blink",
    "engine_version": ""
  }
}

refs. https://userstack.com/documentation#enable_legacy_format

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/userstack.

License

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

FAQs

Package last updated on 24 Jan 2019

Did you know?

Socket

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.

Install

Related posts