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
$(function() { | |
window.fbAsyncInit = function() { | |
FB.init({appId: '132068066870042', status: true, cookie: true, | |
xfbml: true}); //dev | |
//FB.init({appId: '187884157925798', status: true, cookie: true, | |
// xfbml: true}); //prod | |
FB.getLoginStatus(function(response) { | |
if (response.session) { | |
// logged in and connected user, someone you know |
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 savefbuid | |
user = current_user | |
fbuid = params[:fbuid] | |
fbaccess = params[:fbaccess] | |
user.fb_uid = fbuid | |
user.fbaccess = fbaccess | |
@graph = Koala::Facebook::GraphAPI.new(fbaccess) |
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
begin | |
@graph = Koala::Facebook::GraphAPI.new(user.fbaccess) | |
str = "hello fb world" | |
link = HOSTURL+"/comments/"+id #hostURL is an env variable for us | |
returnstr = @graph.put_wall_post(str,{:name=>"linkName",:link=>link}) | |
rescue | |
#eventually we'll have more logic here, but we basically turn it off for now (no more posts if failure) | |
user.fbaccess = nil | |
user.fbusername = nil | |
user.fb_uid = nil |
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 AddLiuidToUsers < ActiveRecord::Migration | |
def self.up | |
add_column :users, :li_uid, :string | |
add_column :users, :li_name, :string | |
end | |
def self.down | |
remove_column :users, :li_uid | |
remove_column :users, :li_name | |
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
<script type="text/javascript" src="http://platform.linkedin.com/in.js"> | |
api_key: <%=@liapp %> | |
authorize: true | |
onLoad: onLinkedInLoad | |
</script> | |
<script type="text/javascript"> | |
function onLinkedInLoad() { | |
IN.Event.on(IN, "auth", onLinkedInAuth); | |
$('#usingstoredLI').hide(); |
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 saveliuid | |
user = current_user | |
liuid = params[:liuid] | |
liname = params[:liname] | |
user.li_uid = liuid | |
user.li_name = liname | |
user.save! | |
respond_to do |format| | |
format.js do |
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
postcomment = "blah blah must be < 140. Oh and # are probably a good idea to use in here". | |
liscript = liscript +%&postToLinkedIn("&+postcomment+%&");& | |
render :update do |page| | |
if !liscript.blank? | |
page << liscript | |
end | |
#other page updates here | |
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
function postToLinkedIn(comment) { | |
IN.API.Raw("people/~/current-status") | |
.method("PUT") | |
.body(JSON.stringify(comment)) | |
.result(handleLIResults) | |
.error(handleLIErrors); | |
}; | |
function handleLIErrors(error) { |
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
qa: | |
solr: | |
hostname: localhost | |
port: 8982 | |
log_level: INFO | |
master_solr: | |
hostname: masterserver.mydomain.com | |
port: 8982 | |
log_level: INFO | |
auto_commit_after_request: true |
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
set somevars, "foobar" | |
namespace :deploy do | |
task :default do | |
update | |
someother_task | |
reindex_solr | |
end | |
task :reindex_solr do |