
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
yandex_detector is a Ruby 1.9.2 wrapper for Yandex.Detector API (http://api.yandex.ru/detector/) wich allows to detect mobile device's properties by it's request headers.
This document describes installation and usage of yandex_detector.
Please report issues on Github.
For feedback, suggestions, etc. write to aishek@gmail.com.
To install:
gem install yandex_detector
or with a Gemfile:
gem 'yandex_detector'
bundle install
Usage in Rails:
require 'yandex_detector'
# API call timeout in seconds (default is 2 seconds)
timeout = 2
result = YandexDetector.detect request.headers, timeout
Usage in Ruby program:
require 'yandex_detector'
# HTTP headers, you need at least one to perform detect
headers = Hash.new[
'user-agent', 'value1'
'profile', 'value2',
'wap-profile', 'value3',
'x-wap-profile', 'value4',
'x-operamini-phone-ua', 'value1'
]
# API call timeout in seconds (default is 2 seconds)
timeout = 2
result = YandexDetector.detect headers, timeout
Result object have following helpers:
result.error?
result.error_message
result.success?
result.iphone?
result.android?
result.blackberry?
Please, see complete list of available helpers.
The RubyDoc documentation is available online.
yandex_detector perform Yandex's API service call via network if there are at least one of needed headers provided. Please, consider right timeout value and fallback on timeout for your application to prevent slow execution.
Idea & implementation — Alexandr Borisov (aishek@gmail.com)
yandex_detector is licensed under MIT
FAQs
Unknown package
We found that yandex_detector 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 new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.