en
Buku
Simon Timms

Social Data Visualization with HTML5 and JavaScript

  • dariadiamembuat kutipan4 tahun yang lalu
    Facebook is the 900 lbs (408.233 kg) gorilla of the social media world.
  • dariadiamembuat kutipan4 tahun yang lalu
    Next, we'll set up a route in the Express application to request the OAuth tokens from Twitter:
    app.get('/requestOAuth', function(req, res){
    function recieveOAuthRequestTokens(error, oauth_token, oauth_token_secret,results) {
    if (!error){
    req.session.oAuthVars = { oauth_token: oauth_token,oauth_token_secret: oauth_token_secret}; res.redirect('https://api.twitter.com/oauth/authorize?oauth_token=' + oauth_token);
    }
    requestOAuthRequestTokens(recieveOAuthRequestTokens);
    });
    function requestOAuthRequestTokens(onComplete){
    getOAuth().getOAuthRequestToken(onComplete);
    }
  • dariadiamembuat kutipan4 tahun yang lalu
    make use of the OAuth library. This can be done with a function as shown in the following code:
    function getOAuth(){
    var twitterOauth = new oAuth.OAuth(
    'https://api.twitter.com/oauth/request_token',
    'https://api.twitter.com/oauth/access_token',
    consumerKey,
    consumerSecretKey,
    '1.0A',
    null,
    'HMAC-SHA1');
    return twitterOAuth;
    }
    We create an OAuth object associated with Twitter. We give the two end-points, and then the consumer key and consumer secret which we received from Twitter earlier.
  • dariadiamembuat kutipan5 tahun yang lalu
    Authentication is the act of ensuring that somebody is who they say they are, while authorization is the act of ensuring that the person has the rights to perform an action.
fb2epub
Seret dan letakkan file Anda (maksimal 5 sekaligus)