# HG changeset patch # User Mathias Gebbe # Date 1402129332 -7200 # Node ID a94ac7c3b182dafb1bb15b7bad0e74e9b23c648d # Parent af9f5b94c01941370ff22c675eac2804019204f1 appId clientid in index.jade, remove logo from index diff -r af9f5b94c019 -r a94ac7c3b182 INSTALL.md --- a/INSTALL.md Fri Jun 06 14:42:28 2014 +0200 +++ b/INSTALL.md Sat Jun 07 10:22:12 2014 +0200 @@ -19,3 +19,11 @@ cp app.js_to_pump.io-client-app_lib node_modules/pump.io-client-app/lib/app.js cp index.js_to_pump.io-client-app_lib_routes node_modules/pump.io-client-app/lib/routes/index.js ``` + +* configure your Facebook App ID and your Google App ID in +``` +views/index.jade + appId: 'FACEBOOKID', + 'cookiepolicy': "https://yourserver.org", + 'clientid': 'GOOOGLEPLUSCLIENTID', +``` diff -r af9f5b94c019 -r a94ac7c3b182 README.md --- a/README.md Fri Jun 06 14:42:28 2014 +0200 +++ b/README.md Sat Jun 07 10:22:12 2014 +0200 @@ -20,6 +20,12 @@ * likes and comments to facebook related pump notes are synced to facebook +#### twitter + +* get tweets from all you follow and post them to pump.io + +* post public pump posts to twitter (max 140 characters) + ####benefits * share googleplus posts to facebook and pump.io diff -r af9f5b94c019 -r a94ac7c3b182 views/index.jade --- a/views/index.jade Fri Jun 06 14:42:28 2014 +0200 +++ b/views/index.jade Sat Jun 07 10:22:12 2014 +0200 @@ -18,11 +18,11 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); - + // load googleplus api sign in script(type='text/javascript'). - + (function() { var po = document.createElement('script'); @@ -37,12 +37,12 @@ gapi.signin.render('gp-root', { 'callback': 'signinCallback', - 'clientid': '460404084439-rgb5r2vh7hh8hvf2na65c7n1ofhmomek.apps.googleusercontent.com', + 'clientid': 'GOOOGLEPLUSCLIENTID', 'redirecturi': 'postmessage', 'response_type' : 'code', 'accesstype': 'offline', 'approvalprompt': 'force', - 'cookiepolicy': "https://do.blessuren.de:3000", + 'cookiepolicy': "https://yourserver.org", 'requestvisibleactions': 'http://schemas.google.com/AddActivity', 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email' }); @@ -57,22 +57,22 @@ // Hide the sign-in button now that the user is authorized, for example: //document.getElementById('signinButton').setAttribute('style', 'display: none'); //alert('googleplus is ready for bridging'); - + gapi.client.load('plus', 'v1', function() { var request = gapi.client.plus.people.get({ 'userId': 'me' }); - request.execute(function(resp) { - //alert(JSON.stringify(resp)); + request.execute(function(resp) { + //alert(JSON.stringify(resp)); $('#gpstatus').html(' ' + resp.displayName + ''); var token = gapi.auth.getToken(); - //alert(JSON.stringify(resp.id)); + //alert(JSON.stringify(resp.id)); $('#gpid').val(resp.id+'@google'); $('#gptoken').val(token.access_token + ';' + token.code); - }); - }); + }); + }); - + } else { // Update the app to reflect a signed out user // Possible error values: @@ -83,7 +83,7 @@ } } - script. + script. // twitter stuff function getCookie(cname) { var name = cname + "="; @@ -94,22 +94,23 @@ } return ""; } - - + + // load facebook api script. $(document).ready(function () { - - $('#twstatus').html(' ' + getCookie('twitteruser') + ''); - + + var twstatus = getCookie('twitterid') + if (twstatus != "") $('#twstatus').html(' ' + getCookie('twitteruser') + ''); + $.ajaxSetup({ cache: true }); $.getScript('//connect.facebook.net/en_UK/all.js', function () { FB.init({ - appId: '771281529571170', + appId: 'FACEBOOKID', status : true }); @@ -118,7 +119,7 @@ // the user is logged in and has authenticated your // app, and response.authResponse supplies // the user's ID, a valid access token, a signed - // request, and the time the access token + // request, and the time the access token // and signed request each expire var uid = response.authResponse.userID; var accessToken = response.authResponse.accessToken; @@ -128,7 +129,7 @@ $('#fbid').val(response.id+'@facebook'); }); } else if (response.status === 'not_authorized') { - // the user is logged in to Facebook, + // the user is logged in to Facebook, // but has not authenticated your app $('#fbstatus').html('not authorized'); } else { @@ -136,10 +137,10 @@ $('#fbstatus').html('not logged in'); } }); - + }); - + $('.fbloginbutton').on('click', function(e){ FB.login(function(response) { @@ -157,12 +158,12 @@ //$('.logoutbutton').on('click', function(e){ // FB.logout(); // }) - $('#pumpobj').val(JSON.stringify(!{JSON.stringify(user)})); + $('#pumpobj').val(JSON.stringify(!{JSON.stringify(user)})); }); body block content - .main + .main h1(class='headline') pumpbridge.
connecting social networks #fb-root.fb-root input(id='fbloginbutton',type='image',class='fbloginbutton',value='fbLogin',src='images/fb.svg',width='100px',height='100px') @@ -171,13 +172,20 @@ //span.g-signin(data-scope='https://www.googleapis.com/auth/plus.login', data-clientid='460404084439-rgb5r2vh7hh8hvf2na65c7n1ofhmomek.apps.googleusercontent.com', data-redirecturi='postmessage', data-accesstype='offline', data-cookiepolicy='single_host_origin', data-callback='signInCallback', approval_prompt='force') #tw-root.tw-root a(href='/add-account'): input(id='twloginbutton',type='image',class='twloginbutton',value='twLogin',src='images/twitter.svg',width='100px',height='100px') - #pump-root.pump-root - a(href='/login') - input(id='pumploginbutton',type='image',class='pumploginbutton',value='pumpLogin',src='images/pumpiologo.svg',width='100px',height='100px') + //#pump-root.pump-root + // a(href='/login') + // input(id='pumploginbutton',type='image',class='pumploginbutton',value='pumpLogin',src='images/pumpiologo.svg',width='100px',height='100px') br form(class='',action='/bridge',method='post') #connect.connect ul + li pump.io: + a(id='pumpstatus',class='pumpstatus',href=user.homepage)= user.id + br + input(id='pumpid',name='pumpid',hidden='true',value=user.id) + input(id='pumptoken',name='pumptoken',hidden='true', value=user.token) + input(id='pumpsecret',name='pumpsecret',hidden='true', value=user.secret) + input(id='pumpobj',name='pumpobj', hidden='true' value='') li Facebook: i(id='fbstatus')   not logged in br @@ -193,13 +201,6 @@ br input(id='twid',name='twid',hidden='true') input(id='twtoken',name='twtoken',hidden='true',size=100) - li pump.io: - a(id='pumpstatus',class='pumpstatus',href=user.homepage)= user.id - br - input(id='pumpid',name='pumpid',hidden='true',value=user.id) - input(id='pumptoken',name='pumptoken',hidden='true', value=user.token) - input(id='pumpsecret',name='pumpsecret',hidden='true', value=user.secret) - input(id='pumpobj',name='pumpobj', hidden='true' value='') br input(type='submit',class='btn btn-default',value='save tokens') .footer