Skip to content

Instantly share code, notes, and snippets.

require 'twitter'
Twitter::Search.new.geocode(39.037, -94.5874, '5mi').fetch().results
#=> all tweets within 5 miles of lat/lon
Twitter::Search.geocode(39.037, -94.5874, '5mi').fetch().results.first
#=> most recent tweet within 5 miles of lat/lon
Twitter::Search.new('dinner').geocode(39.037, -94.5874, '5mi').fetch().results
#=> all tweets containing the word 'dinner' within 5 miles of lat/lon
@erichurst
erichurst / mod_machine.rb
Last active August 29, 2015 13:56
Simple module for dynamic values
module ModMachine
extend ActiveSupport::Concern
included do
end
module ClassMethods
#
# Builds a module with constants assigned to the index passed in the `options` array. Be sure
# to pass all arguments as you would write them manually. In other words `attribute` and any