This file contains hidden or 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
<?php | |
// Change these | |
define('API_KEY', 'Your App API KEY' ); | |
define('API_SECRET', 'Your App API SECRET' ); | |
define('REDIRECT_URI', 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']); | |
define('SCOPE', 'r_fullprofile r_emailaddress rw_nus' ); | |
// You'll probably use a database | |
session_name('linkedin'); | |
session_start(); |
This file contains hidden or 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
// write this under Knockout viewModel | |
// This is an example to send all the users comments to the server | |
// Basic Example we can fit it for other purposes as well | |
self.save = function() { | |
return $.ajax({ | |
url: "comments.php", | |
contentType: 'application/json', | |
type: 'POST', | |
data: JSON.stringify({ |
This file contains hidden or 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
// write this snippet inside the Knockout viewModel | |
// getting all the comments from the server | |
$.getJSON("comments.php", function(commentModels) { | |
var t = $.map(commentModels.comments, function(item) { | |
return new Comment(item); | |
}); | |
self.comments(t); | |
}); |
This file contains hidden or 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
.well-inverse { | |
min-height: 20px; | |
padding: 19px; | |
margin-bottom: 20px; | |
background-color: #ffffff; | |
border: 1px solid #e3e3e3; | |
-webkit-border-radius: 4px; | |
-moz-border-radius: 4px; | |
border-radius: 4px; | |
/* -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.05); |
This file contains hidden or 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
from flask import Flask, request, session, redirect, url_for | |
import urllib | |
import requests | |
app = Flask(__name__) | |
app.secret_key = 'iwonttellyou' | |
redirect_uri = 'http://localhost:5000/callback' | |
client_id = '' # get from https://code.google.com/apis/console | |
client_secret = '' |
NewerOlder