Project

teleportd

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby Wrapper Library for Teleportd API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0

Runtime

>= 0
>= 0
~> 1.7.1
 Project Readme

Teleportd

Ruby Wrapper Library for Teleportd API

Currently, this wrapper only supports the basic search functionality.

Installation

Add this line to your application's Gemfile:

gem 'teleportd'

And then execute:

$ bundle

Or install it yourself as:

$ gem install teleportd

Usage

NOTE: You must set an ENV variable 'TELEPORTD_API_KEY' for your Teleportd API key

$ export TELEPORTD_API_KEY=$APIKEY

Create an instance of a Teleportd::Search with optional filters. The Search returns an enumerable collection of Teleportd::SearchResult objects

Query With Locations:

$ options = {}
$ options[:location] = {}
$ options[:location][:latitude] = 34.19
$ options[:location][:longitude] = -119.49
$ options[:location][:vertical] = 5.0
$ options[:location][:horizontal] = 5.0
$ search = Teleportd::Search.new(options)

Query With Textual Search:

$ options = {}
$ options[:textual_search] = 'foo bar baz'
$ search = Teleportd::Search.new(options)

Query With Time Period (start/end)

$ options = {}
$ options[:time_period] = {}
$ options[:time_period][:start_time] = 5.days.ago
$ options[:time_period][:end_time] = 2.days.ago
$ search = Teleportd::Search.new(options)

Query With Sort (relevance/recency)

$ options = {}
$ options[:sort] = 'relevance'
$ search = Teleportd::Search.new(options)

Options can be combined, of course:

$ options = {}
$ options[:location] = {}
$ options[:location][:latitude] = 34.19
$ options[:location][:longitude] = -119.49
$ options[:location][:vertical] = 5.0
$ options[:location][:horizontal] = 5.0
$ options[:time_period] = {}
$ options[:time_period][:start_time] = 5.days.ago
$ options[:time_period][:end_time] = 2.days.ago
$ options[:textual_search] = 'foo bar baz'
$ search = Teleportd::Search.new(options)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request