Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geoclue

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoclue

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GeoClue Ruby Client

This library allows you to interact with GeoClue via D-Bus. This allows you to get the physical location of your computer just based on your WiFi connection.

For further reference:

  • GeoClue Project Description
  • The GeoClue D-Bus API

This project is currently only developed and tested on Arch Linux, with plans to port to Ubuntu in the near future. It exists on Arch first because the Ubuntu GeoClue provider is so easy to use, I originally used it from a simple bash script.

Installation

Add this line to your application's Gemfile:

gem 'geoclue'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geoclue

Make sure that you have GeoClue installed and running:

$ sudo systemctl status geoclue

If not, it should be available from your distro's package manager:

$ pacman -S geoclue

Usage

Run the executable to get your coordinates

$ geoclue
42.12345,-83.12345

Use the --help flag for more details

$ geoclue --help
Usage: geoclue [option flags]
  Running with no options will print comma-separated coordinates.

  -h --help              print this message

INFORMATION OPTIONS
  -f --full              fetch all location information
  -a --address           fetch address information (requires fetching coordinates)
  -c --coordinates       fetch your coordinates from GeoClue

CONFIGURATION OPTIONS
  -t --timeout [int]     set the timeout for each operation
  -n --no-cache          don't use the cache
  -d --print-config      print out all configuration
     --format [fmt]      output format of data in named printf format
                         named options include "tab" and "pipe"
                         default is "%<key>s: %<val>s\n"

Development

I recommend having a D-Bus debugger tool like d-feet in order to inspect the service API. This tool relies entirely on the org.freedesktop.GeoClue2 system service.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/shreve/geoclue-ruby.

License

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

FAQs

Package last updated on 29 Jun 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc