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 |
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
/* | |
* Name: AbstractRepository | |
* Purpose: To abstract out the Repository interface so that each implementation (ex: UserRepository) | |
* doesn't have to implement every method. | |
* | |
*/ | |
package com.example.dao; | |
import com.example.struts.utilities.HibernateUtil; | |
import java.util.ArrayList; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Hotel> | |
<HotelID>1040900</HotelID> | |
<HotelFileName>Copthorne_Hotel_Aberdeen</HotelFileName> | |
<HotelName>Copthorne Hotel Aberdeen</HotelName> | |
<CityID>10</CityID> | |
<CityFileName>Aberdeen</CityFileName> | |
<CityName>Aberdeen</CityName> | |
<CountryCode>GB</CountryCode> | |
<CountryFileName>United_Kingdom</CountryFileName> |
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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package getdata; | |
import java.math.BigDecimal; | |
import java.util.*; | |
/** |