Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[general] se agrega el boton de like

  • Loading branch information...
commit eabb2179cf7b8f806afe6b29e35e755f75df421b 1 parent b1a39ad
cronopio authored
Showing with 28 additions and 19 deletions.
  1. +1 −1  server.js
  2. +2 −0  views/index.jade
  3. +25 −18 views/layout.jade
View
2  server.js
@@ -56,7 +56,7 @@ var checkUser = function(req, res, next){
app.get('/', checkUser, function(req, res){
jsonreq.get('http://bitcoincharts.com/t/weighted_prices.json', function(err, data) {
res.render('index', {
- title:'Precio del Bitcoin en Facebook',
+ title:'Bitcoin Price on Facebook',
locals: {
dolares: data.USD['24h']
, euros: data.EUR['24h']
View
2  views/index.jade
@@ -1,4 +1,6 @@
.imagenFondo
+ - var fbLike = "<fb:like href='http://www.facebook.com/apps/application.php?id=124829930933291' send='false' width='230' show_faces='false' font='' style='position:absolute;top:110px;left:380px;'></fb:like>"
+ | !{fbLike}
p(class='fbbox', style='position:absolute;top:155px;left:140px;')
img(src='/images/iconBtc.png', width='16px', height:'16px', style='float:left;')
span(style='margin-left:4px;') Today's price is: USD
View
43 views/layout.jade
@@ -5,31 +5,38 @@ html
link(rel='stylesheet', href='/stylesheets/style.css')
script(type='text/javascript', src='http://connect.facebook.net/en_US/all.js')
script(type='text/javascript', src='js/fx.js')
- body!= body
+
+ meta(property="og:title", content="Bitcoin Price of Day")
+ meta(property="og:type", content="activity")
+ meta(property="og:url", content="http://www.facebook.com/apps/application.php?id=124829930933291")
+ meta(property="og:image", content="/images/iconMeta.png")
+ meta(property="og:site_name", content="Bitcoin Price of Day")
+ meta(property="fb:app_id", content="124829930933291")
+ body
#fb-root
+ != body
+
script(type='text/javascript')
- FB.init({
- appId: '124829930933291',
+ FB.init({appId: '124829930933291',
status: true,
cookie: true,
xfbml: true
});
+
FB.getLoginStatus(function(res){
- console.log(res);
if (res.session){
- console.log(res.session);
- FB.api('/me', function(user){
- if (user != null){
- var userLine = document.getElementById('userLine');
- var imagen = document.createElement('img');
- imagen.src = 'http://graph.facebook.com/'+user.id+'/picture';
- userLine.appendChild(imagen);
- var nombre = document.createElement('span');
- nombre.style['margin-left'] = '5px';
- nombre.style['font-weight'] = 'bold';
- nombre.innerHTML = user.name;
- userLine.appendChild(nombre);
- }
- });
+ FB.api('/me', function(user){
+ if (user != null){
+ var userLine = document.getElementById('userLine');
+ var imagen = document.createElement('img');
+ imagen.src = 'http://graph.facebook.com/'+user.id+'/picture';
+ userLine.appendChild(imagen);
+ var nombre = document.createElement('span');
+ nombre.style['margin-left'] = '5px';
+ nombre.style['font-weight'] = 'bold';
+ nombre.innerHTML = user.name;
+ userLine.appendChild(nombre);
+ }
+ });
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.