This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# how to save a record | |
# console... | |
key = "your key" | |
secret = "your secret" | |
# Chattanooga lat/lon = 35.0456297 / -85.3096801 | |
client = Simplegeo.new( key, secret, "yourlayer" ) | |
records = Simplegeo::Records.new( client ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% title '<script language="javascript">alert("See, this works");</script>' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThirdpartyController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :get_consumer_info, :except => [ :index ] | |
def index | |
session[:request_token] = nil | |
end | |
def tripit | |
gem 'oauth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThirdpartyController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :get_consumer_info, :except => [ :index ] | |
def index | |
session[:request_token] = nil | |
end | |
def tripit | |
gem 'oauth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key = [92, 28, 3, 18, 62-8, 49-2-10, 74-8, 922, 87-9, 102, 67, 17, 17.99, 105, 129, 147, 189, 202, 88] | |
msg = 'D6U17E2TPCZ6C8D2DND8C8C02335QF8OD1AS4A3947BDA3DB8VFAOG43B3ED8R69ER235L6BE72JLA9'.downcase | |
msg += 'DJGI948NXTPTEMWIOMGNNZTP'.downcase | |
msg += 'pe85$%99e0zfj'.upcase.downcase | |
msg += 'Q&,;k.4qD_L/fZ2P0zyP)??@~=$YL_uTk6<t>tr(%US4)v1>\jfk5zPrF|5\Rnf' | |
msg += 'LEm5n18AplaOGJxUS6F8vlF7SWgRuH23KlPObtlJaqeipkYYrtPVliafI8NfCJk'.chomp | |
decode = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ThirdpartyController < ApplicationController | |
before_filter :authenticate_user! | |
before_filter :get_consumer_info, :except => [ :index ] | |
def index | |
session[:request_token] = nil | |
@tripit = current_user.authorizations.where(:provider => "tripit") | |
end | |
def tripit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if k == "ActivityObject" | |
if @tripit_trip[k].is_a?(Hash) | |
@tripit_trip[k]["ObjectType"] = "ActivityObject" | |
tmp[ @tripit_trip[k]["StartDateTime"]["date"] ] = [] if tmp[ @tripit_trip[k]["StartDateTime"]["date"] ].nil? | |
tmp[ @tripit_trip[k]["StartDateTime"]["date"] ] << @tripit_trip[k] | |
elsif @tripit_trip[k].is_a?(Array) | |
@tripit_trip[k].sort_by { |h| h["StartDateTime"]["date"] }.each do |o| | |
o["ObjectType"] = "ActivityObject" | |
tmp[ o["StartDateTime"]["date"] ] = [] if tmp[ o["StartDateTime"]["date"] ].nil? | |
tmp[ o["StartDateTime"]["date"] ] << o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LikesController < ApplicationController | |
before_filter :get_ids | |
respond_to :json | |
def videolink | |
results = {} | |
# check to see if the user has liked this videolink before |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LikesController < ApplicationController | |
before_filter :get_ids | |
respond_to :json, :js | |
def videolink | |
results = {} | |
# check to see if the user has liked this videolink before |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def likes_the(obj) | |
like = Like.find_or_initialize_by_likeable_type_and_likeable_id_and_user_id(obj.class.name, obj.id, self.id) | |
like.amount = 1 | |
like.save | |
end |
OlderNewer